Codded
Codded

Reputation: 1256

jwplayer not working in Internet Explorer

Having issues with jwplayer in Internet Explorer

JW Player version: 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: It loads and plays fine but I get this on the console

LOG: Could not add internal listener

ie8:

Error loading player: Could not load player configuration

ie9:

Error loading media: File could not be played 

And I get this on the console:

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

Works fine in all other browsers

UPDATE:

As i had many jwplayers in one page (10 max) I implemented a click to load the players. For some reason this has fixed the ie 8 issue

<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>

Upvotes: 2

Views: 11248

Answers (3)

Arjan Kruithof
Arjan Kruithof

Reputation: 1

I stumbed upon the same today. I tried to compile the video over and over again. But still only working in Chrome, but not Internet Explorer of Firefox.

Than i found out to change the MIME type in IIS for mp4 from video/mpeg to video/mp4

that worked perfect :)

Upvotes: 0

pelicanorojo
pelicanorojo

Reputation: 47

If you work with IE, you can use a player state sniffer like the attached below. When the player is ready for effective event listener subscribtions, the state turn from undefined to a string value, ( 'IDLE' ).

Then you can attach event listeners when detect this status change.

I guess this is a solution that must be inside of jwplayer code. :) I am using version 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();

Upvotes: 0

Steve
Steve

Reputation: 21

check the Response header when it calls the .MP4 file.

Make sure you are sending Content-Length: in your response. IE9 was failing to load videos until the content-length response header was added to the config.

also Transfer-Encoding:chunked can mess things up too, which is common if you are gzipping the MP4 file.

Upvotes: 2

Related Questions