Audio Streaming not working in android
Unsolved
QML and Qt Quick
-
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/live32below 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(); } } } }
-
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
-
Hi,
You should also add which version of Qt your are using as well as platform of development.
-
Which version of Qt 5.9 ?
-
The please first update to 5.9.1