0

I use the video player videojs below :

<video id="font_video" class="video-js vjs-default-skin" controls preload="none" width="700" height="360" poster="" data-setup="{}">
  <source src="xxx.mp4" type='video/mp4' />
  <source src="xxx.webm" type='video/webm' />
</video>

<script>
   _V_.options.flash.swf = "assets/video-js.swf";
</script>

The above code successfully runs in Safari,but doesn't run in Chrome and Firefox.

If I swap the mp4 and webm position, like this:

<video id="font_video" class="video-js vjs-default-skin" controls preload="none" width="700" height="360" poster="" data-setup="{}">
  <source src="xxx.webm" type='video/webm' />
  <source src="xxx.mp4" type='video/mp4' />
</video>

Then the code doesn't run in Safari anymore, but runs in Chrome and Firefox. Does anybody have an explanation ?

Kevin Junghans
  • 17,475
  • 4
  • 45
  • 62
JeskTop
  • 481
  • 1
  • 4
  • 20
  • are you sure just by changing the positions the video is working in chrome and firefox? . Which version of safari are you using? – karthick Mar 29 '13 at 04:08
  • 1
    have you checked that each video will play in Chrome and Safari without VideoJS in the picture, just a regular ` – Offbeatmammal Mar 29 '13 at 13:47
  • @karthick Yes.My safari version is 6.0.3.I edit my problem, I think videojs must play the first . – JeskTop Mar 29 '13 at 16:22
  • @Offbeatmammal I use jplayer can play the video in the chrome and safari.I edit my problem, I think videojs must play the first . – JeskTop Mar 29 '13 at 16:25
  • @Offbeatmammal When I delete the ``, Safari can not play and Chrome can. – JeskTop Mar 29 '13 at 16:27
  • The VideoJS docs imply it should be fine. Do you have pointers to a sample page with real videos we can check (I'm wondering if there's a MIME type or encoding issue that's breaking things) – Offbeatmammal Mar 29 '13 at 17:13
  • @Offbeatmammal Thanks, I am changing the positions the video can solve this problem. The webm video must at the first source. You can post your answer, I will select your answer. – JeskTop Apr 01 '13 at 14:12
  • I wonder if the problem is that the encoding of the mp4 is not quite right so when Chrome tries to play it it fails but doesn't fall through to the WebM version either – Offbeatmammal Apr 01 '13 at 15:32
  • But why safari can play the mp4? – JeskTop Apr 01 '13 at 16:42

0 Answers0