Hotfix: Fix autoplay issues for embedded players #5399

Merged
DispatchCommit merged 1 commit from hotfix/videojs-lifecycle into master 2021-01-27 14:49:31 +01:00
DispatchCommit commented 2021-01-27 14:41:41 +01:00 (Migrated from github.com)

Adds new autoplay prop to VideoJs component for specifying the value of autoplay passed to video.js player.

Copy pastes the old logic (used to calculate shouldPlay into this new property, and passes it to VideoJs component.

The result should be that in cases where shouldPlay is false, player would behave identically to previous behavior (before refactoring) by setting the autoplay flag to false, and not calling the function to try and begin autoplaying.

shouldPlay will return false when player is embedded and autoplayIfEmbedded is also false. Therefore, this should not impact the improvements made on LBRY / Odysee that we received from turning autoplay to true.

Partially resolves #5391

Adds new `autoplay` prop to `VideoJs` component for specifying the value of `autoplay` passed to `video.js` player. Copy pastes the old logic (used to calculate `shouldPlay` into this new property, and passes it to `VideoJs` component. The result should be that in cases where `shouldPlay` is false, player would behave identically to previous behavior (before refactoring) by setting the `autoplay` flag to false, and *not* calling the function to try and begin autoplaying. `shouldPlay` will return false when player is embedded *and* `autoplayIfEmbedded` is *also* false. Therefore, this should not impact the improvements made on LBRY / Odysee that we received from turning autoplay to `true`. Partially resolves #5391
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#5399
No description provided.