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

Poster is loaded twice #1355

Closed
levi0214 opened this issue Feb 22, 2019 · 5 comments
Closed

Poster is loaded twice #1355

levi0214 opened this issue Feb 22, 2019 · 5 comments

Comments

@levi0214
Copy link

levi0214 commented Feb 22, 2019

Just open the official demo https://plyr.io, and you'll find the poster image loaded twice as below. I am not sure if this is necessary?

screenshot

@sampotts
Copy link
Owner

Yep it is unfortunately as we display it in a custom element. The only other solution would involve removing the progressive enhancement. I don’t think removing the poster attribute with JavaScript would abort the initial load. I doubt it.

@levi0214
Copy link
Author

Haha, OK, thank you.

@dev7ch
Copy link

dev7ch commented Feb 22, 2019

maybe you could append the image to the custom element from media element maybe with sth like

let sourceImage = document.createElement('img'),
     imgContainer = document.getElementById("custom-element");
 sourceImage.src = "[some img url or cloning loaded poster img]";
 imgContainer.appendChild(sourceImage);

 function cloneImg(){
     imgContainer.appendChild(sourceImage.cloneNode(true));
 }

not tested ;)

@sampotts
Copy link
Owner

If we had access to the shadow DOM then we could clone the contents yep but its not possible.

@sampotts
Copy link
Owner

Closing this one for now as there's not much we can do.

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

No branches or pull requests

3 participants