2011-08-31 84 views
0

我想設置我的網頁播放視頻時使用以下規格:問題的JW播放器嵌入代碼 - 用HTML5後備

  • 使用許可JW播放器使用
  • Flash播放器, HTML5回落
  • 我也想爲HTML5後備(OGG,WEBM)提供替代文件格式
  • 使用RTMP流方法通過CloudFront的交付視頻

這裏是我的測試頁面的鏈接: http://coachesmarketingcenter.com/test_new_ppts/index3.html

這是我目前使用的嵌入代碼:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
    <title>Test New Videos</title> 

    <script type='text/javascript' src='http://coachesmarketingcenter.com/test_new_ppts/swfobject.js'></script> 

    <script type="text/javascript" src="http://coachesmarketingcenter.com/test_new_ppts/jwplayer.js"></script> 

</head> 
<body> 

    <div id="container1"></div> 

    <script type="text/javascript"> 
     jwplayer("container1").setup({ 
      file: "TestNewVideos/MyNewVideo.mp4", 
      provider: "rtmp", 
      streamer: "rtmp://s2cr83yb7q2jav.cloudfront.net/cfx/st", 
      width: 640, 
      height: 480, 
      modes: [{ 
       type: "flash", 
       src: "http://coachesmarketingcenter.com/test_new_ppts/player.swf" 
      },{ 
       type: "html5", 
       config: { 
        file: "http://dn9lu4lqda9r4.cloudfront.net/TestNewVideos/MyNewVideo.mp4", 
        provider: "video" 
       } 
      levels: [ 
       { file: "http://dn9lu4lqda9r4.cloudfront.net/TestNewVideos/MyNewVideo.mp4" }, // H.264 version 
       { file: "http://dn9lu4lqda9r4.cloudfront.net/TestNewVideos/MyNewVideo.ogg" }, // Ogg Theora version 
      ] 
     }); 
    </script> 

</body> 
</html> 
+0

不知道什麼問題 - 似乎爲我工作好嗎? – Jason

+0

它看起來像你的視頻文件無效。嘗試使用不同的鏈接。 – oshikryu

回答

0
+2

請注意,[只有鏈接的答案](http://meta.stackoverflow.com/tags/link-only-answers/info)不鼓勵,所以答案應該是搜索解決方案的終點(vs.而另一個引用的中途停留時間往往會隨着時間推移而過時)。請考慮在此添加獨立的摘要,並將鏈接保留爲參考。 – kleopatra