Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Audio Streaming not working in android
QtWS25 Last Chance

Audio Streaming not working in android

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
audiomultimediaqmlaudio qmlaudioplayer
7 Posts 2 Posters 3.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • QjayQ Offline
    QjayQ Offline
    Qjay
    wrote on last edited by
    #1

    Hey i am trying to play audio stream from web . It's a live audio . The audio is playing fine on desktop but not on mobile device .
    audio url : http://sgpc.net:8070/live32

    below is code

    import QtQuick 2.0
    import QtMultimedia 5.5
    import QtWebView 1.1
    import QtQuick.Controls 1.4
    
    
    Item {
        function play_pause()
        {
            console.log("reached here");
            if(playPause == false)
            {
                console.log("play");
                audio1.play();
                playPause = true;
            }
            else if (playPause == true)
            {
                console.log("stop");
                audio1.stop();
                playPause = false;
            }
            else
            {
                console.log("invalid");
            }
        }
    
        property bool playPause: false
        id: audio_layout
    
        Image {
            id: logo
            width: pane.width
            height: pane.height
            anchors.centerIn: parent
            anchors.verticalCenterOffset: -50
           fillMode: Image.PreserveAspectFit
            source: "qrc:/images/bg.jpg"
        }
        Item {
            width: audio_layout.width
            anchors.centerIn: audio_layout
    
            Audio {
                id: audio1
                source: "http://sgpc.net:8070/live32"
            }
    
            Button{
                width: audio_text1.implicitWidth + 50
                height: audio_text1.implicitHeight + 50
                Text{
                    font.pixelSize: 25
                    id: audio_text1
                    width: 236
                    height: 41
                    anchors.centerIn: parent
                    text: "Live  Audio"
                    renderType: Text.NativeRendering
                    fontSizeMode: Text.HorizontalFit
                    verticalAlignment: Text.AlignVCenter
                    horizontalAlignment: Text.AlignHCenter
                    color: "black"
                }
    
                anchors.centerIn: parent
                onClicked: {
                   play_pause();
    
                }
    
            }
    
    
        }
    
    
    
    }
    
    
    
    1 Reply Last reply
    0
    • QjayQ Offline
      QjayQ Offline
      Qjay
      wrote on last edited by Qjay
      #2

      these are the logs when i deploy the app on my device

      D MediaHTTPConnection: filterOutInternalHeaders: key=User-Agent, val= stagefright/1.2 (Linux;Android 6.0.1)
      D MediaHTTPConnection: proxy null port 0
      D MediaHTTPConnection: filterOutInternalHeaders: key=User-Agent, val= stagefright/1.2 (Linux;Android 6.0.1)
      D MediaHTTPConnection: proxy null port 0
      D MediaHTTPConnection: filterOutInternalHeaders: key=User-Agent, val= stagefright/1.2 (Linux;Android 6.0.1)
      D MediaHTTPConnection: proxy null port 0
      D MediaHTTPConnection: filterOutInternalHeaders: key=User-Agent, val= stagefright/1.2 (Linux;Android 6.0.1)
      D MediaHTTPConnection: proxy null port 0
      I DpmTcmClient: RegisterTcmMonitor from: com.android.okhttp.TcmIdleTimerMonitor
      D SantBaani: qrc:/pages/live.qml:30 (play_pause): qml: reached here
      D SantBaani: qrc:/pages/live.qml:33 (play_pause): qml: play
      D SantBaani: qrc:/pages/live.qml:30 (play_pause): qml: reached here
      D SantBaani: qrc:/pages/live.qml:39 (play_pause): qml: stop
      D SantBaani: qrc:/pages/live.qml:30 (play_pause): qml: reached here
      D SantBaani: qrc:/pages/live.qml:33 (play_pause): qml: play
      D SantBaani: qrc:/pages/live.qml:30 (play_pause): qml: reached here
      D SantBaani: qrc:/pages/live.qml:39 (play_pause): qml: stop
      D SantBaani: qrc:/pages/live.qml:30 (play_pause): qml: reached here
      D SantBaani: qrc:/pages/live.qml:33 (play_pause): qml: play
      D SantBaani: qrc:/pages/live.qml:30 (play_pause): qml: reached here
      D SantBaani: qrc:/pages/live.qml:39 (play_pause): qml: stop
      D SantBaani: qrc:/pages/live.qml:30 (play_pause): qml: reached here
      D SantBaani: qrc:/pages/live.qml:33 (play_pause): qml: play
      
      
      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        You should also add which version of Qt your are using as well as platform of development.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • QjayQ Offline
          QjayQ Offline
          Qjay
          wrote on last edited by
          #4

          i am using qt 5.9 on Linux mint 18 KDE and the platform which i am targeting is android .

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Which version of Qt 5.9 ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • QjayQ Offline
              QjayQ Offline
              Qjay
              wrote on last edited by
              #6

              qt-opensource-linux-x64-5.9.0 .

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                The please first update to 5.9.1

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved