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. Qt 5.6 Looping Video in a Playlist
Forum Updated to NodeBB v4.3 + New Features

Qt 5.6 Looping Video in a Playlist

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

    Newbie Qt Multi Media Question.
    I have a quick question about a simple application I have written that loads a few video clips and I can play each and advance to the next one. I am using the playlist in QML (Qt 5.6 on Ubuntu, Qt Quick UI app). Here is one problem , I want to loop over the "current" video until I hit "next" and then advance to the next video and if at the last video , start from the first one, so when I set loops: MediaPlayer.Infinite, it does not loop, it plays through the playlist once

    However, if I use playbackMode: Playlist.Loop in the PlayList block, the looping is over the entire play list not the currently playing one. If I set the playlist to CurrentItemInLoop, it loops over the current video but then I cannot advance to the next video in the list, it just restarts the current video. I am sure this is probably a stupid newbie mistake since this is really a simple app, but is there a trick to this?

    Thanks so much

    MediaPlayer {
    id: player
    autoLoad: true
    playlist: Playlist {
    id: plist
    PlaylistItem {source: "/somepath/vido0"}
    PlaylistItem {source: "/somepath/vido1"}
    PlaylistItem {source: "/somepath/vido2"}
    PlaylistItem {source: "/somepath/vido3"}
    playbackMode: Playlist.Loop <------ loops over the entire list
    }
    autoPlay: true
    // loops: MediaPlayer.Infinite <----- does not loop at all plays through the list once and it stops

    }
    
    VideoOutput {
        id: video
        anchors.fill: parent
        source: player
    
    }
    
    
    
    
     Item {
        focus: true
        Keys.onPressed:  {
            if (event.key == Qt.Key_N) {
                plist.next()
            }
            if (event.key == Qt.Key_S) {
                   player.pause()
            }
            if (event.key == Qt.Key_P) {
                   player.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