luwes/playerx

Play () and pause () methods for facebook.

abvas opened this issue · 2 comments

abvas commented

How to make facebook play () and pause () methods work right after source is loaded.

I have hung the play () and pause () methods on the buttons. But immediately after loading the page, they do not work and only start working after I click on the controls on the video itself.

Here's a test case:
https://codepen.io/abvas/pen/QWqxBmZ?editors=1010

This only happens with facebook, with other providers these methods are triggered immediately after loading.
Everything works fine on your demo page, but I can't make them work correctly.

Please advise me how to fix it, what I am doing wrong.

Thank you.

luwes commented

Yes, I've noticed FB is difficult with this.

I have special code in the benchmark to workaround this issue but this is not possible in a regular browser.
https://github.com/playerxo/playerx/blob/3e8b2bf937f56f243578a9442b413d5cb7033916/bench/index.js#L41-L49

Does it help if the video is muted before trying to play?

abvas commented

Yes, it helped me muted before trying to play.
As I understand it is related to Autoplay policy in Chrome:
https://developer.chrome.com/blog/autoplay/

Thank you.