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

Remove cast button video pause #6293

Closed
fkoemep opened this issue Feb 25, 2024 · 2 comments · Fixed by #6359
Closed

Remove cast button video pause #6293

fkoemep opened this issue Feb 25, 2024 · 2 comments · Fixed by #6359
Assignees
Labels
platform: Cast Issues affecting Cast devices priority: P3 Useful but not urgent status: archived Archived and locked; will not be updated type: enhancement New feature or request
Milestone

Comments

@fkoemep
Copy link

fkoemep commented Feb 25, 2024

Have you read the FAQ and checked for duplicate open issues?
Yes

Is your feature request related to a problem? Please describe.

Whenever I press the cast button, the video always pauses. This does not happen in websites such as YouTube (which is the cast behaviour I'm seeking)

Describe the solution you'd like

I would like to have a flag or any other way of avoiding pausing the video when I click the cast button.

Describe alternatives you've considered

I though about monkey patching the library locally but it'd be much better to have a native option for this.

Additional context

The method getInitState_() inside cast_proxy.js should be modified so that the video resumes playing after this.localVideo_.pause();, or removing that line so the video never pauses.

@fkoemep fkoemep added the type: enhancement New feature or request label Feb 25, 2024
@shaka-bot shaka-bot added this to the Backlog milestone Feb 25, 2024
@joeyparrish
Copy link
Member

You are welcome to submit a PR for this, but the shaka.cast APIs are slated for removal in v5.0.0. We will be moving away from custom messaging between sender and receiver and moving cast functionality out of shaka.cast and into the UI.

@fkoemep
Copy link
Author

fkoemep commented Feb 27, 2024

Since the API is going to be removed I just ended up creating a monkey-patch that resumes the video after the cast button is pressed, I'm going to leave it here in case anyone needs it.

//resume video after pausing for casting

const originalCastFunction = shaka.cast.CastProxy.prototype.cast;
const modifiedCastFunction = async function () {
   originalCastFunction.bind(this)();
   ui.getControls().getLocalVideo().play();
};
shaka.cast.CastProxy.prototype.cast = modifiedCastFunction;

I call it after player.load();

@avelad avelad added the platform: Cast Issues affecting Cast devices label Feb 29, 2024
@joeyparrish joeyparrish added the priority: P3 Useful but not urgent label Mar 12, 2024
@avelad avelad modified the milestones: Backlog, v5.0 Mar 25, 2024
@avelad avelad self-assigned this Mar 25, 2024
joeyparrish pushed a commit that referenced this issue Mar 26, 2024
…lished (#6359)

CastProxy's getInitState_() pauses the local video as part of a transfer
of state to the receiver. Calling getInitState_() (via CastSender's
onInitStateRequired_()) should be deferred until we establish a
connection. This keeps the local video from pausing during a connection
attempt.

Closes #6293
avelad added a commit that referenced this issue Apr 8, 2024
…lished (#6359)

CastProxy's getInitState_() pauses the local video as part of a transfer
of state to the receiver. Calling getInitState_() (via CastSender's
onInitStateRequired_()) should be deferred until we establish a
connection. This keeps the local video from pausing during a connection
attempt.

Closes #6293
avelad added a commit that referenced this issue Apr 8, 2024
…lished (#6359)

CastProxy's getInitState_() pauses the local video as part of a transfer
of state to the receiver. Calling getInitState_() (via CastSender's
onInitStateRequired_()) should be deferred until we establish a
connection. This keeps the local video from pausing during a connection
attempt.

Closes #6293
joeyparrish pushed a commit that referenced this issue May 7, 2024
…lished (#6359)

CastProxy's getInitState_() pauses the local video as part of a transfer
of state to the receiver. Calling getInitState_() (via CastSender's
onInitStateRequired_()) should be deferred until we establish a
connection. This keeps the local video from pausing during a connection
attempt.

Closes #6293
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label May 25, 2024
@shaka-project shaka-project locked as resolved and limited conversation to collaborators May 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform: Cast Issues affecting Cast devices priority: P3 Useful but not urgent status: archived Archived and locked; will not be updated type: enhancement New feature or request
4 participants