-
Notifications
You must be signed in to change notification settings - Fork 836
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
how to resolve the problem that Chrome 66 turning off autoplay released in April 2018 #40
Comments
In Chrome, muted autoplay is always allowed. See the policy. So autoplay is available in xgplayer with config "volume: 0". |
In my project my video still cant auto play at chrome 68.0.3440.84 on macOS High Sierra, i suspect It be effected the warning message: Failed to load http://img-test.aixuexi.com/B:1005:K/1532448000/0caeb04be45a4447b9896015eb1bf02c.mp4: Request header field Range is not allowed by Access-Control-Allow-Headers in preflight response. i add the config: ### crossOrigin: true official demo can auto play. it url: http://h5player.bytedance.com/examples/ |
@zhangzs000 If you are trying to use xgplayer with xgplayer-mp4 plugin, your video server should support range request. With range request, the warning will not happen again. |
operating environment: i remove the the plugin xgplayer-mp4, no warning "Request header field Range is not allowed by Access-Control-Allow-Headers in preflight response." in chrome now. but it still cant auto play. so i suspect the reason is asynchronous request then i change the ajax to synchronization,It still cant auto play. now i dont know why it cant auto play on chrome? i use xgplayer "version": "1.0.5" in vue project |
@zhangzs000 Did you config "volume: 0"? |
it can auto play on firefox and 360 browser,but in chrom I am sad ..... T_T......PM demand it can autoplay on chrome. |
Muted autoplay in Chrome is supported by a30892. You can try with the branch now or wait for v1.0.8 as soon as possible. |
wa, you are great. Why can official examples auto play in chrome? |
Chrome calculates MEI score for sites. policy autoplay When MEI is high enough, media playback without muted is allowed to autoplay on desktop only. Maybe the official site of xgplayer in your Chrome gets a high MEI. |
See your MEI in chrome://media-engagement/ |
@zhangxin92 |
when i new a xgplayer instance that has a config autoplay: true, but it not auto at chrome.
so i switch the browsers to use firefox. it works.
how to resolve this problem
after i use the play method referencing api documents
player.play()
then chrome has a error:
Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first
The text was updated successfully, but these errors were encountered: