I wanted to render a video from a webcam in the background of a qt quick application. I used this code from 5.1.1 documentation to render a test video:
import QtQuick 2.0
import QtMultimedia 5.0
Item {
MediaPlayer {
id: mediaplayer
source: "groovy_video.mp4"
}
VideoOutput {
anchors: parent.fill
source: mediaplayer
}
MouseArea {
id: playArea
anchors.fill: parent
onPressed: mediaplayer.play();
}
}
I have no QtQuick experience and it is double frustrating if not even the example (unmodified) is working:
Invalid property assignment: "anchors" is a read-only property
anchors: parent.fill
What is wrong?