在 Internet Explorer 中遇到 jwplayer 问题
JW播放器版本:6.1.2972
<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
即8:
Error loading player: Could not load player configuration
即9:
Error loading media: File could not be played
我在控制台上得到了这个:
LOG: Error playing media: [object MediaError]
LOG: CAPTIONS([object Object])
LOG: CAPTIONS([object Object])
在所有其他浏览器中都能正常工作
更新:
由于我在一页中有很多 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>