qt: introduce immersive mode feature (global PiP mode)
Immersive mode is merely a combination of these states:
- Interface window title bar is off (CSD is on).
- Interface window is always on top.
- Minimal mode is on.
This is essentially what we can provide to have "global" PiP mode, similar to what modern web browsers provide nowadays.
The immersive mode toggle button is added to:
- The top bar of player page.
- PiP player.
- Minimal mode view.
The immersive mode toggle button is only visible when there is video output. And, when video output is over, the immersive mode gets disabled automatically.
If the user overrides states required for immersive mode while immersive mode is active, disabling the mode does not revert the state. Otherwise, disabling immersive mode reverts the states it changed for its functioning.
I believe that combined with !6991 (closed), this can be really useful for the users.
Request review @chub.
Merge request reports
Activity
added MRStatus::Reviewable label
mentioned in merge request !6991 (closed)
changed milestone to %4.0
added Component::Interface: Qt label
requested review from @chub
added MRStatus::WaitingForReviewerFeedback label and removed MRStatus::Reviewable label
I'm all for having a global (detachable) PiP window, but I'm not sure this is the right way. We should aim to have an experience similar to the ones in browsers, the video is send to a floating window and controls (either player or medialibrary) are kept in place.
technically this means either:
- being able to re-parent the video to another window (do all compositor supports this?)
- do some window trickeries (make the window containing the video the PiP window and popup a new window with the same state in place of the former window), but there's so many way this goes wrong
A few years back I made some attempts to implement something alike (primary goal was being able to send video to a given screen while retaining the controls (the problematic are similar to a pip window). The branch was formally submitted as I wasn't really pleased with the code.
for reference:
I'm all for having a global (detachable) PiP window, but I'm not sure this is the right way. We should aim to have an experience similar to the ones in browsers, the video is send to a floating window and controls (either player or medialibrary) are kept in place.
We can still have detached PiP window in the future. If this is merged, I believe there would be less demand for it though.
I do not advertise this as detached PiP window. I mentioned that to show interested people what this is about. I had to invent a name for this, I came up with "immersive mode", but probably it is not the best name to come up with.
This is basically a combination of some states, nothing more than that. However, according to my experience, it does a good job of mimicking PiP feature.
technically this means either:
If we need QML overlay, it needs to be a Qt Quick Window and I guess then we need to have the same suffering for video integration in that other window. I'm not sure if this is worth to do it. I'm not sure if there is a solid use case of user wanting to have the main interface, and another interface with a QML overlay.
If overlay is not wanted, the user can already disable video integration and have "PiP mode" with the always on top setting for the video window.
Note that if you strictly oppose having any control in the minimal mode, then this merge request is practically useless. That is the main point of this, that is, the users can have their favorite controls if they want as well as seek bar. Browsers currently provide seek bar and some controls in the detached video window.
Maybe minimal mode should be kept as minimal, and not have any control including the seek bar. And have actual "immersive mode" that has seek bar and controls. I'm not sure what is better, I did not want to make this more complicated. If you strictly oppose minimal mode having controls, I can close !6991 (closed), and integrate the changes here.
I realized that Windows 11's media player has this very same functionality (minimal mode + always on top). It is named "mini player" there. It is funny they have the seek bar, although when I introduced !6991 (closed) this was not on my mind.
added MRStatus::Reviewable label and removed MRStatus::WaitingForReviewerFeedback label
added MRStatus::InReview label and removed MRStatus::Reviewable label
added MRStatus::NotCompliant label and removed MRStatus::InReview label
added 164 commits
-
a576e1c6...d1409377 - 156 commits from branch
videolan:master
- 76f2ce53 - qt: add a flag to represent the active main view modes to MainCtx
- 80c8f915 - qml: make MinimalMode and Player view modes rather than pages handled by history
- 6b94502f - qt: make player mode a toggle in the View menu
- e99ec120 - qt: import `pip.svg` to VLCIcons.ttf
- 84e5d0c6 - qml: fix logic in `ControlBar.qml` regarding control layout visibility
- c657275e - qml: expose video surface as a property in `MinimalView`
- 2027d5f2 - qml: expose csd decorations item as a property in `MinimalView`
- 8dd11d34 - qt: introduce immersive mode
Toggle commit list-
a576e1c6...d1409377 - 156 commits from branch
Rebased on !7037.
I have used the following for default style:
{ PlayerControlbarModel::Immersiveplayer, { { { ControlListModel::ARTWORK_INFO }, { ControlListModel::SKIP_BACK_BUTTON, ControlListModel::PREVIOUS_BUTTON, ControlListModel::PLAY_BUTTON, ControlListModel::NEXT_BUTTON, ControlListModel::SKIP_FW_BUTTON }, { ControlListModel::VOLUME, ControlListModel::FULLSCREEN_BUTTON } } } }
and the following for minimalist style:
{ PlayerControlbarModel::Immersiveplayer, { { { ControlListModel::SKIP_BACK_BUTTON, ControlListModel::PREVIOUS_BUTTON, ControlListModel::PLAY_BUTTON, ControlListModel::NEXT_BUTTON, ControlListModel::SKIP_FW_BUTTON }, { }, { ControlListModel::VOLUME, ControlListModel::FULLSCREEN_BUTTON } } } }
The rest of the styles are empty, so only the seek bar would be shown. Subject to change.
added 210 commits
-
8dd11d34...113e5a86 - 201 commits from branch
videolan:master
- 721fe7c9 - qt: add a flag to represent the active main view modes to MainCtx
- c5f7410c - qml: make MinimalMode and Player view modes rather than pages handled by history
- 866b46b0 - qt: make player mode a toggle in the View menu
- e9eed669 - qt: import `pip.svg` to VLCIcons.ttf
- 0fecdf9f - qml: fix logic in `ControlBar.qml` regarding control layout visibility
- bc5bcc7c - qml: expose video surface as a property in `MinimalView`
- e8c40960 - qml: expose csd decorations item as a property in `MinimalView`
- 0499d281 - qml: expose pinned state as a property in `ControlBar`
- 1b90070d - qt: introduce immersive mode
Toggle commit list-
8dd11d34...113e5a86 - 201 commits from branch
added MRStatus::InReview label and removed MRStatus::NotCompliant label
added MRStatus::NotCompliant label and removed MRStatus::InReview label