2012-04-08 45 views
3

我已經下載了文件,並按照提供的步驟,但玩家根本不工作。jwplayer不工作

<code> 
    <html> 
    <head> 
    <script type="text/javascript" src="/jwplayer.js"></script> 
    <script type="text/javascript" src="/jquery.js"></script> 

    </head> 

    <body> 
    <div id="container">Loading the player ...</div> 
    <script type="text/javascript"> 
    jwplayer("container").setup({ 
    flashplayer: "/player.swf", 
    file: "/video.mp4", 
    height: 270, 
    width: 480 
    }); 
    </script> 
    </body> 
    </html> 
    </code> 

它顯示的只是「加載播放器」。正如你所看到的,我已經鏈接了JWplayer和jQuery腳本。我錯過了什麼?任何幫助將不勝感激。我使用web表達式...當我嘗試按照jwplayer鏈接「jwplayer(容器)」時,我說無法找到鏈接。

+1

你可以發佈什麼錯誤,你的調試器顯示?另外,player.swf,video.mp4 jwplayer.js和jquery.js文件位於何處?您是否可以使用http://example.com/player.swf等在地址欄中訪問它們? – jmort253 2012-04-08 20:14:52

+0

嘗試在'src'屬性中使用相對地址或嘗試使用〜/作爲主屬性。 – 2012-04-08 20:18:03

+0

jwplayer未定義 http://irvinetireoutlet.com/landslide.html 第35行.............................. ............................這就是我雖然問題是... – Amnesiac11 2012-04-08 21:59:01

回答

6

試試看看這個代碼。與相對地址,它適用於我!我希望這能幫到您。

<!DOCTYPE html> 
<html> 
    <head> 
     <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jplayer/2.9.2/jplayer/jquery.jplayer.min.js"></script> 
     <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js/jquery.js"></script> 
    </head> 
    <body> 
     <div id="container">Loading the player ...</div> 
     <script type="text/javascript"> 
      jwplayer("container").setup({ 
      flashplayer: "//cdnjs.cloudflare.com/ajax/libs/jplayer/2.9.2/jplayer/jquery.jplayer.swf", 
      file: "http://content.bitsontherun.com/videos/lWMJeVvV-364767.mp4", 
      height: 270, 
      width: 480 
     }); 
     </script> 
    </body> 
</html> 
+1

爲什麼需要jquery文件 – 2013-12-19 05:20:18

+0

我保留它,因爲它在他的例子。不知道她的依賴。 – 4x3LDev 2014-03-25 10:32:46

+0

http://player.longtailvideo.com/不再可用... – PJunior 2016-07-28 19:58:12

3

剛剛獲得在你的代碼擺脫/,使其內容如下:

flashplayer: "player.swf"