0

I am trying to implement a Qt/QML video player that allows multiple videos to play at once, the Idea is similar to a monitoring system that controls, play,pause,seek etc 8 channels at the same time.

I am a beginner and I have attached my code, the problem I is that video 2 is appearing but video 1 is not appearing.

import QtQuick 2.1

import QtMultimedia 5.0

import QtQuick.Controls 1.3

Item{

Video{

id:video1

width: 460

height: 360

source :"F:/TestingVideos/Cash Office Camera/N01000713.mp4"

}



Video{

id:video2

width: 460

height: 360

source :"F:/TestingVideos/Cash Office Camera/N02000713.mp4"

}

MouseArea {

anchors.fill: parent

onClicked: {

    video1.play()

    video2.play()

 }

}

}

Billal
  • 17
  • 5

1 Answers1

1

Probably, your items are not placed correctly. You must either set x, y positions of 2nd item explicitly or use Layouts, which is preferred. Qt Quick Layouts are a set of QML types used to arrange items in a user interface. Read more about Qt Quick Layouts in official framework documentation, there's also an example of using it and overview.

Leonid.cpp
  • 124
  • 7
  • Thanks, for the reply, I tried layout, the grid one before but the issue I was having was that it was rigid and I wanted to render,resize the video window. Do you have any idea of how to a tleast slipt the qmlscene windows to multiple widgets?, such that I can put code on each of those widget to output video independently – Billal Mar 03 '15 at 10:28