changing source on html5 video tag

前端 未结 16 1826
既然无缘
既然无缘 2020-11-22 08:31

i\'m trying to build a video player, that works everywhere. so far i\'d be going with:

16条回答
  •  渐次进展
    2020-11-22 09:27

    Modernizr worked like a charm for me.

    What I did is that I didn't use . Somehow this screwed things up, since the video only worked the first time load() was called. Instead I used the source attribute inside the video tag -> and used Modernizr to determine what format the browser supported.

    
    

    Hopefully this will help you :)

    If you don't want to use Modernizr , you can always use CanPlayType().

提交回复
热议问题