2014-03-07 48 views
1

我在我的Asp.Net MVC應用程序的View上使用了jwPlayer 6.8。 我使用下列關於播放器的流視頻的javascript代碼:JW播放器沒有顯示Flash模式,也沒有在Asp.Net MVC視圖中顯示播放器控件

var el = document.getElementById("player"); 

var player = jwplayer(el).setup({ 
      file: "W-UNIT1", 
      streamer: "rtmp://my-server/live", 
      type: "rtmp", 
      width: 383, 
      height: 300, 
      controls: true, 
      primary: "flash", 
      modes: [ 
      { type: "flash", src: '/jwPlayer68/jwplayer.flash.swf' }, 
      { type: "html5" } 
      ], 
      events: { 
       onReady: function() { 
        player.play(); 
       } 
      } 
     }); 

播放器播放視頻罰款,但如果我右鍵點擊播放器表面就說明我經常窗口的上下文菜單,但不閃像設置,全局設置菜單等 也沒有控制器上出現像靜音,播放/暫停等球員 當前版本我使用的是6.8版本。我的瀏覽器是Firefox版本27.0.1

我錯過了什麼?

+0

哪個版本的jwplayer正在使用?你有任何鏈接來檢查問題? – Hitesh

+0

這是JW Player的第6版。 –

+0

任何鏈接或jsfiddle? – Hitesh

回答

0

你正在使用Jwplayer 6.8,然後嘗試使用下面的設置,而不是你的。

jwplayer("myElement").setup({ 
    playlist: [{ 
     image: "/assets/myVideo.jpg", 
     sources: [{ 
      file: "rtmp://example.com/application/mp4:myVideo.mp4" 
     },{ 
      file: "/assets/myVideo.mp4" 
     }] 
    }], 
    height: 360, 
    primary: "flash", 
    width: 640 
}); 

我想你的設置是遵循舊的jwplayer參數。

Jwplayer具有引導這個位置

Using RTMP streaming

RTMP single stream

有用的#1問題:

how-do-i-play-rtmp-streams-with-jw-player

streaming-with-cloudfront-to-jwplayer

using-dynamic-smil-file-with-jw-player

0

好像我已經再次找到了答案,我自己提出的問題。

問題既不與rtmp流有關,也不針對任何特定版本的JW Player。事實上,它不僅發生在新版本和舊版本上。 這是因爲我的一些自定義CSS應用到JW Player HTML div容器中而發生的。出於某種原因,我在Asp.Net視圖中覆蓋了它的CSS,並導致了這個問題。

我的示例代碼:

HTML:

<body> 
    <script src="http://jwpsrv.com/library/bfifOqXfEeOr_yIACi0I_Q.js"></script> 
    <div id="player"></div>  
</body> 

的Javascript:

$(function() { 
    var el = document.getElementById("player"); 

    var player = jwplayer(el).setup({ 
      file: "http://techslides.com/demos/sample-videos/small.mp4", 
      width: 383, 
      height: 300, 
      controls: true, 
      events: { 
       onReady: function() { 
        player.play(); 
       } 
      } 
     }); 
}); 

CSS:

div[id^=player_] 
{ 
    /* Comment this css for correct working of jwplayer */ 
    min-width:383px !important; 
    min-height:300px !important; 
} 

這裏是的jsfiddle此:

http://jsfiddle.net/QCyzh/2/

相關問題