4

I have a video output embedded in a QML view. It is working fine, but I want to make that video output go fullscreen when I click on it.

Every time, some images that are in the view (some sibiling, and some not) are visible on top of my video. In fact, it should fill the root element, and be at the front screen. Changing the z property doesn't do anything.

What is the best trick to make a video go fullscreen? When I switch from normal to fullscreen, the video should continue its flow with no interuption.

A solution only in QML (and no C++) would be preferable, as I build my QMLs by parsing XML files.

Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325
lolo.io
  • 770
  • 5
  • 22

2 Answers2

3

You can create new fullscreen window from QtQuick.Window module and pass tpo that window video path,time and play.

Component {
    Window{
        id: videoWindow
        flags: Qt.FramelessWindowHint
        HereYourPlayer{

        }

    }
}

than you should create that Component and call videoWindow.showFullScreen()

Dcow
  • 1,413
  • 1
  • 19
  • 42
  • Thank you for your help. This works, but i have a little jump when i switxh form normal size to fullscreen. This is quite annoying because the video is not smooth when switching from normal size to fullscreen. – lolo.io Feb 20 '14 at 13:40
0

I finaly found the solution I needed. In fact it was simplier that it seemed. I created an Item just under the root, and I changed the parent of my video element when I wanted to go fullscreen. I put my new Item as the parent of my video element. I didnt know that we could change the parent of an element.

lolo.io
  • 770
  • 5
  • 22
  • For anyone having doubts about states (and transitions) to change the parent of a component, I highly suggest watching this basic video: https://www.youtube.com/watch?v=1cI-elp7QXQ – BourbonCreams Feb 12 '19 at 09:45