Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background fix and Binge Watch fix for stremio-shell with stremio-web v5 #757

Open
wants to merge 7 commits into
base: development
Choose a base branch
from

Conversation

Zaarrg
Copy link

@Zaarrg Zaarrg commented Dec 17, 2024

⚠️ What Issues

  1. Transparent background not reset using back button when watching via stremio-shell
  2. Binge watching next video not working at all via stremio-shell qt5

✨ How Fixed

  1. Fixed by resetting background on click of the back button
  2. Seems like a timeout of >600ms fixes this as the fast redirect causes a fake tls error. This seems to be a compatibility issue with qt5 and the old chromium version that it uses. On the stremio-shell side the only error is [ffmpeg] tls: Unknown error which does not really help. Tried also on window load and dom content load but both did not work.

ℹ Qt5 issues moving to Qt6

  • In general the web v5 ui and qt5 do not really work well together. Using stremio-shell build with qt5.12.2 the ui is fully unresponsive and non functional. Seems like this issue is also related.
  • This got fixed using the latest qt5: 5.15.16 built with vcpkg. Can be tested here: stremio-shell-web-v5 .
  • Qt6 here, wayyy better then qt5.
  • I suspect it's the old chromium version combined with the react web ui. As qt5.15.16 has a more recent chromium version and that fixed many issues.
  • But even with this there are still some issue, like the pop in fade animation on the show banners when u visit a new page being quite slow / lagging.
  • All those qt issues got fixed when I built stremio-shell using latest qt6 here. Sadly qt6 cant be used atm as it does not allow the webview background to be transparent and render the video behind it. See this offical bug-tracker. When this bug is fixed qt6 can be used.

- Fixed background of body and app still being transparent after stopping shell video watch
- Fixed bingewatch not working on stremio-shell v5 qt5
- ffmpeg errors for some reason with [ffmpeg] tls: Unknown error if the window change is to fast.
- For now fixed with >600ms timeout.
(In qt6 this does not happen)
@CLAassistant
Copy link

CLAassistant commented Dec 17, 2024

CLA assistant check
All committers have signed the CLA.

@jaruba
Copy link
Member

jaruba commented Dec 17, 2024

@Zaarrg so we could use Qt v6.4.1? 😅

@jaruba
Copy link
Member

jaruba commented Dec 17, 2024

TBH we are hoping to not use Qt at all in the future, we have a new shell we've been working on that uses WebView2 for Windows, which we are hoping to release soon
MacOS and Linux are far from getting a new shell that doesn't use Qt though..

@Zaarrg
Copy link
Author

Zaarrg commented Dec 17, 2024

@Zaarrg so we could use Qt v6.4.1? 😅

@jaruba
I think its qt6 in general. The builds i used where 6.8.1 and 6.5.3 and both had that bug.

When looking into that issue i found that the jellyfin-media-player guys who started porting to qt6 quite some time ago did not solve it yet aswell. Instead they made they controls in qt6. See this issue.

TBH we are hoping to not use Qt at all in the future, we have a new shell we've been working on that uses WebView2 for Windows, which we are hoping to release soon MacOS and Linux are far from getting a new shell that doesn't use Qt though..

Yeah WebView2 could be definitely better. Noticed also when i ran the web ui via electron as a test that the ui was way smoother then in qt5.

But even with WebView2 i think qt6 when possible should be used. As this will allow for the broadest compatibility.
Tbf when i tested with qt6 I didn't really find any other issues, ui was smooth and responsive enough.

Will also investigate this further tho and maybe find a good solution or even fix for qt6.
Because currently the only way it works with webview on top of player is by setting the WebView visible: false and therefor no player controls from the web ui.

@Zaarrg
Copy link
Author

Zaarrg commented Dec 18, 2024

@Zaarrg so we could use Qt v6.4.1? 😅

Okay so i kinda feel stupid now, but checked again today and it seems like the qt maintenance tool outplayed me. Even tho it said i had the right version 6.8.1 and 6.5.3 they were indeed not installed... So checked again today with the right qt 6.8.1 and everything works fine with web ui v5

So now will probably port stremio-shell to qt6.8.1

Edit: Ported it and works very well. Can be tested here

- Added numpad arrows as additional option for player usage. Needed because on some keyboard qt6 just shows the arrow keys as numpad arrows for some reason.
- Better background transparent check on back nav. To prevent it always removing from undefined properties when not coming from the player
- Fixed on tv shows next video not autoplaying
- Move transparency reset to unmount. Not sure why i didnt in the first place...
- Next Video playback fixed, removed weird timer
- Issue caused by loadfile being called twice and the onEnded function player.NextVideo always being null

1. When NextVideoPopUp called onNextVideoRequested() this called nextVideo() on the player. The player then sends the stop command to mpv.
1.1 The stop command triggers the event onEnded and as well sets the player.NextVideo to null because the video was stopped and because player.NextVideo was always null in that onEnded useCallback it always called window.history.back() even if onNextVideoRequested() was previously called by the next video pop up meaning player.nextVideo was not null

- Fixed that the onEnded function always had player.NextVideo as null by using a nextVideoInitialData ref. This fixed the onEnded playback making it possible when the video ends the next video plays automatically.

2. Now when the user clicks on Watch Now on the NextVideoPopUp it would again like in 1. triggered onEnded and then triggering the onNextVideoRequested() inside onEnded.
2.2 This causes mpv to receive two playback commands causing as well a tls error.

- Fixed that in qt as mpv returned every MPV_EVENT_END_FILE back to the web ui not matter if needed or not causing onEnded to trigger always and causing nextVideo(); to also trigger onEnded in the webui triggering again onNextVideoRequested and this causing a tls error because of two playback commands in quick succession.

- Those two fixes fixed the nextVideo playback.
- Added skip, pause, previous media keybinds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants