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. QML Video on iOS not working?
Forum Updated to NodeBB v4.3 + New Features

QML Video on iOS not working?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 472 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.
  • P Offline
    P Offline
    Placeable
    wrote on last edited by Placeable
    #1

    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();
                    }
                }
            }
        }
    }
    
    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