0

我正在做一个需要我同时播放多个视频并控制它们的项目。到目前为止,我可以单击 qmlscene,该应用程序将播放所有视频。现在我想为速度和进度添加播放/暂停按钮、搜索按钮和滑块。

我当前的代码如下:

import QtQuick 2.1
import QtMultimedia 5.0

Rectangle{

    id:mainRect
    width: 1900
    height: 950
    color:"darkgrey"

    Video{
        id:video1   
        x:0
        y:50
        width: mainRect.width/3
        height: 360
        source :"F:/TestingVideos/Cash Office Camera/N01000713.mp4"
    }

    Video{
        id:video2
        x:450        
        y:50        
        width: mainRect.width/3        
        height: 360        
        source :"F:/TestingVideos/Cash Office Camera/N02000713.mp4"       
    }

    Video{  
        id:video3     
        x:900       
        y:50       
        width: mainRect.width/3       
        height: 360       
        source :"F:/TestingVideos/Cash Office Camera/N03000713.mp4"        
    }    

    Video{    
        id:video4        
        x:1350        
        y:50        
        width: mainRect.width/3        
        height: 360        
        source :"F:/TestingVideos/Cash Office Camera/N04000713.mp4"        
    }       

    Video{        
        id:video5        
        x:0        
        y:420        
        width: mainRect.width/3       
        height: 360        
        source :"F:/TestingVideos/Cash Office Camera/N05000713.mp4"       
    }

    Video{        
        id:video6        
        x:450        
        y:420        
        width: mainRect.width/3        
        height: 360        
        source :"F:/TestingVideos/Cash Office Camera/N06000713.mp4"        
    }  

    Video{       
        id:video7       
        x:900        
        y:420       
        width: mainRect.width/3        
        height: 360        
        source :"F:/TestingVideos/Cash Office Camera/N07000713.mp4"        
    }

    Video{      
        id:video8       
        x:1350       
        y:420        
        width: mainRect.width/3        
        height: 360        
        source :"F:/TestingVideos/Cash Office Camera/N08000714.mp4"        
    }  

    MouseArea {       
        x: 26        
        anchors.rightMargin: 0        
        anchors.bottomMargin: 0        
        anchors.leftMargin: 0        
        anchors.topMargin: 0        
        anchors.fill: parent        

        onClicked: {            
            video1.play()            
            video2.play()            
            video3.play()            
            video4.play()          
            video5.play()            
            video6.play()            
            video7.play()            
            video8.play()            
        }        
    } 
}
4

0 回答 0