Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to play Video in Ubuntu using QML



  • Hi Everyone ,

    Can anyone help to play video using QML in ubuntu



  • Hi @Sushma_MP

    Following piece of code should help you to play video if your Ubuntu machine is setup with GStreamer.

    import QtMultimedia 5.0

    Window {
    title: qsTr("Hello World")
    width: 640
    height: 480
    visible: true
    Video
    {
    id: video
    anchors.fill: parent
    source: "file:///home/manu/Desktop/Projects/song.mp4"

        MouseArea {
            anchors.fill: parent
            onClicked: {
                video.play()
            }
        }
    }
    

    }


Log in to reply