2013-02-14 137 views
2

與jwplayer有問題,在Internet Explorerjwplayer在Internet Explorer中不工作

JW Player版本:2972年6月1日

<div id="mediaplayer_1294">JW Player goes here</div> 

<script type="text/javascript"> 
jwplayer("mediaplayer_1294").setup({ 
flashplayer: "jwplayer/jwplayer.flash.swf", 
file: "media.php?file=encoded_2012-10-19_17.13.24_1360841686.mp4&folder=shareddocs&user=9759", 
image: "media.php?file=encoded_2012-10-19_17.13.24_1360841686.jpg&folder=thumb&user=9759", 
controlbar: "bottom", 
width: "380", 
height: "200", 
primary: "html5", 
type: "mp4", 
controls: true, 
allowscriptaccess: 'always', 
bufferlength: 5 
}); 
</script> 

IE7:加載和播放罰款,但我得到這個在控制檯上

LOG: Could not add internal listener 

IE8

Error loading player: Could not load player configuration 

IE9

Error loading media: File could not be played 

而且我得到這個在控制檯上:

LOG: Error playing media: [object MediaError] 
LOG: CAPTIONS([object Object]) 
LOG: CAPTIONS([object Object]) 

工作正常,在所有其他瀏覽器

UPDATE:

由於我在一頁中有很多jwplayers(最多10個),我實現了一個點擊來加載玩家。 出於某種原因,這已經修復了IE 8的問題

<div class="player-<?php echo $row['p_id']; ?>"> 
<div id="mediaplayer_<?php echo $row['p_id']; ?>"></div> 
<a href="#player-<?php echo $row['p_id']; ?>" id="btn_<?php echo $row['p_id']; ?>"><img src="<?php echo $thumb_path; ?>"/></a> 
</div> 

<script type="text/javascript"> 
$(document).ready(function() { 
$("#btn_<?php echo $row['p_id']; ?>").click(function() { 
$(this).hide(); 
jwplayer('mediaplayer_<?php echo $row['p_id']; ?>').setup({ 
flashplayer: "jwplayer/jwplayer.flash.swf", 
file: "<?php echo $flv_path; ?>", 
image: "<?php echo $thumb_path; ?>", 
controlbar: "bottom", 
width: "380", 
height: "200", 
autostart: "true", 
primary: "html5", 
type: "mp4", 
controls: true, 
allowscriptaccess: 'always' 
}); 
jwplayer('mediaplayer_<?php echo $row['p_id']; ?>').load(); 
setTimeout(function(){$(".player-<?php echo $row['p_id']; ?>").focus();return false;},100); 
}); 
}); 
</script> 
+0

1)更新到6.2,這已被釋放。 2)關於IE9的問題,我相當肯定它與你的MIME TYPE有關,但爲了證實這一點,你有鏈接嗎? – emaxsaun 2013-02-14 15:31:41

+0

感謝您的回覆.....我已經更新到6.2。3115和MIME TYPE設置爲標題('Content-Type:video/mp4');更新後重新測試,仍然相同。它的所有密碼保護,所以不能給你一個鏈接,任何其他建議 – Codded 2013-02-14 15:42:56

+0

這應該是好的。我可能需要查看鏈接才能看到發生了什麼。你能通過這種方式發送嗎? - http://www.longtailvideo.com/contact-us – emaxsaun 2013-02-14 16:54:04

回答

2

檢查時,它調用的.MP4文件的響應頭。

確保你要發送Content-Length:在你的回覆中。 IE9無法加載視頻,直到content-length響應頭添加到配置中。

Transfer-Encoding:chunked也可以搞砸了,這是常見的,如果你是gzipping MP4文件。

0

如果你使用IE瀏覽器,你可以使用像下面所附的播放器狀態嗅探器。 當播放器準備好有效的事件監聽器訂閱時, 狀態將從undefined轉換爲字符串值('IDLE')。

然後,您可以在檢測到此狀態更改時附加事件偵聽器。

我想這是一個解決方案,必須在jwplayer代碼中。 :) 我正在使用版本5.9.2156。

//Use as an exambple, it may be buggy. 
var 
    MyObj = { 
     pool: 50, 
     interval: null, 
     videoElement: jwplayer('videoAd'), 
     attachEvents: function() { 
      this.interval = window.setInterval (_.bind(function() { 
      if (this.videoElement) { 
       var 
        state = this.videoElement.getState(); 

       if (typeof state !== 'undefined') { 
        window.clearInterval (this.interval); 
        this.videoElement 
        .onError(function() { console.log('jwplayer: onError') }) 
        .onReady(function() { console.log('jwplayer: onReady') }) 
        .onPlay(function() { console.log('jwplayer: onPlay') }) 
        .onComplete(function() { console.log('jwplayer: onComplete') }); 
       } 
      } 
     }, this), this.pool); 
    } 
}; 

MyObj.attachEvents(); 
0

今天我就恍惚了。我試圖一遍又一遍地編譯視頻。但仍然只能在Chrome中使用,而不能在Firefox的Internet Explorer中使用。

比我發現,從視頻/ MPEG爲MP4改變MIME類型在IIS中的視頻/ MP4

奏效完美:)

相關問題