Meteor JS HTML5 Video element playback

ε祈祈猫儿з 提交于 2019-12-13 18:47:51

问题


So I have a <video> element that has its video in a <source> element found in the <video> element. I can press some buttons (each one has a data url to a local video) and these videos get loaded into the <source> element's src value. My <video> has attributes loop and muted (no controls attribute). I also have a custom play button that I target using jQuery, and use that to play the video. This solution works fine on desktop.

However, I keep getting this error:

Failed to execute 'play' on 'HTMLMediaElement': API can only be initiated by a user gesture.

Any ideas? Supporting code for my meteor file can be found here: https://gist.github.com/rohanbhangui/3b42ff7886bc3c52fcf8

EDIT: I read up a bit on google and found this https://stackoverflow.com/a/32571967/2280670 <-- but I could not make any sense of it and how to use that in a meteor context

来源:https://stackoverflow.com/questions/34862952/meteor-js-html5-video-element-playback

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!