Skip to content

Migrate video player from video.js to shaka-player#4978

Merged
FreeTubeBot merged 128 commits intoFreeTubeApp:developmentfrom
absidue:shaka-migration
Sep 2, 2024
Merged

Migrate video player from video.js to shaka-player#4978
FreeTubeBot merged 128 commits intoFreeTubeApp:developmentfrom
absidue:shaka-migration

Conversation

@absidue
Copy link
Member

@absidue absidue commented Apr 18, 2024

Migrate video player from video.js to shaka-player

Pull Request Type

  • Bugfix
  • Feature Implementation

Related issue

Description

After almost a years worth of work, here is the shaka-player migration.

Significant improvements and new features

  • vp9 and opus during DASH playback. vp9 only works on the local API and Invidious instances that have a version number of 2024.07.21 or newer.
  • The video player will now match the users display language when possible (41/45 locales) and custom player elements added by FreeTube are now translatable. shaka-player doesn't support Estonian et (eesti keel), Basque eu (Euskera), Galician gl (galego) and Icelandic is (Íslenska), for those languages it will use English (US) instead.
  • Stats are now supported for all 3 Media Formats, not just DASH.
  • Switching formats will keep your playback rate, selected subtitle, audio language and video quality settings, additionally the player will no longer flash while switching.
  • The player should be a lot more usuable on mobile screens, as player elements get moved into an overflow menu when they don't fit.
  • You can now watch just finished live streams (Post-Live-DVR) from the start with the local API and you'll get thumbnails on the seek bar when they are available (the thumbnails seem to be missing on about 50% of Post-Live-DVR streams).
  • The video player will pick up most settings changes without having to leave the watch page, such as changing the display language or the playback rate interval.
  • Subtitles will now work on live streams that have them (very rare but they do exist).
  • Support for VR videos that use equirectangular projection, shaka-player doesn't support YouTube's other projection types yet, local API only (The ANDROID_TESTSUITE client that Invidious uses, claims that all video streams use normal rectangular projection, so we don't have a way to identify VR videos through Invidious).

Significant bug fixes

  • The subtitle translation feature now works on all videos, not just ones that are in English local API only.
  • Starting at a certain timestamp from the video URL or resuming a partially watched video, should now work all the time, instead of just randomly.
  • Long videos start straight away and no longer freeze FreeTube for almost a minute.

Missing/Removed features

  • shaka-player doesn't have any subtitle settings. Maybe in the future we could implement our own ones, but it's not-trivial to implement, so creating a replacement is out-of-scope for this pull request.
  • I removed the ability to seek into sponsor block segments that are set to skip, as it was causing the skipping to not work properly, due to the existing implementation being fundamentally flawed. If someone would like to add something like that back in the future, it should require a specific user-interaction to unskip the segment, e.g. a button in the skip message, instead of allowing users to manually seek into the segment.

Known issues

  • Focus is not restored properly from exiting video player menus using keyboard navigation (will not be addressed in this pull request).

Screenshots

DASH

dash

DASH with controls faded away

dash-controls-faded-away

DASH in full screen mode

dash-fullscreen

DASH in full window mode

dash-full-window

DASH stats

dash-stats

Audio only with seek bar thumbnails and stats visible

audio-only-with-stats-thumbnails

Audio only with quality selector visible

audio-only-with-stats-quality

DASH with a vertical video/short

short-dash

Audio only with a vertical video/short and the FreeTube locale preference set to French

ui-language-french

Mobile audio only with the the overflow menu closed

mobile-menu-closed

Mobile audio only with the overflow menu open

mobile-menu-open

Mobile DASH with the overflow menu open on a video with subtitles and multiple audio languages

mobile-menu-open-everything

VR video that uses equirectangular projection

vr-equirectangular-projection

Testing

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: 0.20.0

@absidue
Copy link
Member Author

absidue commented Apr 21, 2024

Relevant Invidious pull requests:

  • Fix proxying live DASH streams iv-org/invidious#4589
    Current workaround: Use HLS manifests when proxying is enabled, which means no seeking but at least you can still watch the live stream.
  • API: Return actual stream height, width and fps iv-org/invidious#4586
    Current workaround: Fetch the DASH manifest in addition to making the API request, as their DASH manifest doesn't use harcoded values. However as Invidious' player doesn't support WebM DASH, they only include the h264 and AV1 streams in the DASH manifests, so supporting vp9 when Invidious is used as the backend or proxying is enabled is not currently possible.

@github-actions

This comment was marked as outdated.

1 similar comment
@github-actions

This comment was marked as duplicate.

@efb4f5ff-1298-471a-8973-3d47447115dc

This comment was marked as outdated.

Co-authored-by: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com>
@github-actions

This comment was marked as outdated.

@PikachuEXE
Copy link
Member

Tested live streams
Re-tested auto generated caption for 4.0.11
No idea what else or if anything else should be tested

@ngocphamm

This comment was marked as resolved.

@PikachuEXE
Copy link
Member

Player settings > Display play button in video player

@ngocphamm

This comment was marked as resolved.

@github-actions github-actions bot added PR: merge conflicts / rebase needed and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Aug 26, 2024
@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@PikachuEXE
Copy link
Member

No further tests from me (except daily test via custom build) until something else popups up

Copy link
Member

@ChunkyProgrammer ChunkyProgrammer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm approving under the assumption that we will do a Release Candidate sometime before the next full release

@absidue
Copy link
Member Author

absidue commented Aug 30, 2024

A release candidate sounds good to me, as this pull request contains a lot of changes.

@absidue absidue added the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 31, 2024
Copy link
Member

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's RC

@efb4f5ff-1298-471a-8973-3d47447115dc

This comment was marked as outdated.

@FreeTubeBot FreeTubeBot merged commit b3ff837 into FreeTubeApp:development Sep 2, 2024
@CodingMadness

This comment has been minimized.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

PR: dependencies Pull requests that update a dependency file

Projects

None yet

10 participants