Play two mediaPlayer side by side using Qt



  • I created a Quick Application and want to play two mediaPlayer side by side using Qt? any advice?
    I am able to compile the code below, but it cannot run.

    Window{
    visible: true
    width: 360
    height: 360

             MouseArea{
             anchors.fill:  parent
             onClicked: Qt.quit();
             }
             MediaPlayer{
              id:player2
              source:"/home/common/abc.mp4"
    

    }

    }



  • vivelu, how to make the video flickable
    I am able to make a square flicker inserting the element below

    Rectangle {
    width:100;height:100
    color:"red"
    sequentialAnimation on x{
    loops:Animation.Infinite
    PropertyAnimation{ to:50}
    PropertyAnimation{ to:0}
    }
    }

    My code below to make mp4 flick is not working.

    Flickable {
    width:200; height:200
    contentWidth:image.width; contentHeight:image.height

      Image { id:image; source:"file:///home/common/xx.mp4"}
    

    }



  • i need to start and stop the video using a timer from c++

    I could create & destroy an qml object from C++
    QQuickView view;
    view.setSource(QUrl:fromLocalFile("MyItem.qml));
    view.show();
    QObject *object=view.rootObject();

    but i would like to change a change a property in Qtmultimedia to stop the player using
    item{
    property int someNumber:100

    QQmlProperty::write(object, "someNumber",5000);
    }

    Any advice?


Log in to reply
 

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