I'm trying to play test video with qml by this code:
import QtQuick 2.2 import QtMultimedia 5.0 Item { width: 300 height: 300 MediaPlayer { id: player source: "C:\\Downloads\\video.mp4" } VideoOutput { id: video anchors.fill: parent source: player } MouseArea { anchors.fill: parent onPressed: player.play() } }
But, when I click on view, nothing happens. And if I change onPressed
event to something else action (not with the player
), it works fine, then it's not a MouseArea
problem.
Where did I wrong?
Thank you.