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. How to play video using QML with start video any time?
Forum Updated to NodeBB v4.3 + New Features

How to play video using QML with start video any time?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 133 Views 1 Watching
  • 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.
  • T Offline
    T Offline
    TamLe
    wrote on last edited by TamLe
    #1

    I want to run a sample video using QML .
    When i am runnimng the following code :

    import QtQuick 6.4
    import QtMultimedia
    import sample_video
    
    Window {
        width: 800
        height: 600
    
        visible: true
        title: "sample_video"
    
        property real time_s: 60000
    
        Component.onCompleted: {
             mediaplayer.play();
             mediaplayer.position = 5000
        }
    
        Component.onDestruction: {
    
        }
    
        MediaPlayer {
            id: mediaplayer
            source: data.source_video
            // position: 5000
            videoOutput: videoOutput
            onErrorOccurred: (error,errorString)=> {
                                 console.log( errorString);
                             }
    
        }
    
        VideoOutput {
            id: videoOutput
            anchors.fill: parent
        }
    }
    

    however the video play time starts at 0. is there any way i can set this time?
    Also this time is taken from c++ side. however in QML there is no support for "long long" type is there any way to handle this problem?

    Win 10 - QT6.4.3

    Thanks.

    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