Skip to content
This repository has been archived by the owner on Jun 22, 2021. It is now read-only.

Play() does not start the video when called before 'playerLoadedMetadata' #71

Open
Thomasvdam opened this issue Sep 18, 2017 · 0 comments

Comments

@Thomasvdam
Copy link
Member

Thomasvdam commented Sep 18, 2017

We ran into this issue with Smooth streams, but it could be an issue on the core level. Worth investigating if we can reproduce this with other media types.

Turns out this is by design. However, it would by nice if there is a property we can use to check whether we need to wait or not before we call play.

Something that basically boils down to this:

const state = { canPlay: false };

player.one('itemLoaded' () => { state.canPlay = true; });

function onUserClicksPlay() {
    if (state.canPlay) {
        player.play();
    } else {
        player.one('itemLoaded', () => { player.play(); });
    }
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant