QML Video on iOS not working?



  • I am using Qt 5.7 for iOS and I have the following QML Markup for videos that does not seem to work on a iPhone 5 using iOS 8.1.

    Please note it works fine on Desktop (Win/Mac) and Android. I did read somewhere that Qt did not support QML Video for iOS and it had to be done native but this was back for Qt 5.3. Is this still not fixed?

    When trying to play the video on a iPhone I get the following output in Xcode:
    "defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer""

    import QtQuick 2.0
    import QtMultimedia 5.6
    
    Item {
        width: parent.width
        height: video.height
        clip: true
    
        property string src: ""
        property string posterSrc: ""
        property bool isNormalAspect: false
    
        function stopVideo() {
            video.stop();
            //video.visible = false;
        }
    
        Video {
            id: video
            width : parent.width
            height: isNormalAspect ? (parent.width * 0.56) : (parent.width * 0.75);
            source: src
            fillMode: VideoOutput.PreserveAspectCrop
    
            Rectangle {
                id: overlay
                width: parent.width;
                height: parent.height
                anchors.fill: parent
                color: "#D3D3D3"
                visible: video.playbackState != MediaPlayer.PlayingState
    
                Image {
                    clip: true
                    width: parent.width
                    height: parent.height
                    anchors.fill: parent
    
                    fillMode: Image.PreserveAspectCrop
    
                    sourceSize.width: 256
                    sourceSize.height: 256
                    source: posterSrc
                }
    
                Image {
                    width: 48
                    height: 48
                    anchors.verticalCenter: parent.verticalCenter
                    anchors.horizontalCenter: parent.horizontalCenter
    
                    sourceSize.width: 48
                    sourceSize.height: 48
                    source: "qrc:/extended_content_play.png"
                }
            }
    
            MouseArea {
                anchors.fill: parent
                onClicked: {
                    if ( video.playbackState == MediaPlayer.PlayingState ) {
                        video.pause();
                        //video.visible = false;
                        overlay.visible = true;
                    }
                    else {
                        video.visible = true;
                        overlay.visible = false;
                        video.play();
                    }
                }
            }
        }
    }
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.