Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

JWplayer crashes on iOS, all other browsers work fine.


Hey guys,

On my website http://www.facecolor.cc I have an problem which only occurs on iOS. When the new page is loaded an animations are finished I launch the function checkForVideo();

bc.. function checkForVideo(){
$('.VideoModule, .VideoHolder').each(function(i, obj){
var videoObject = $(this);
var videoWidth = videoObject.width();
var videoHeight = videoWidth/1920*1080;

if( videoObject.find('div').length == 0 ){
var id = videoObject.prop('id');
var videoUrl = videoObject.data('src');
if(id==''){
id = Math.round(Math.random()*100000000) ;
}
id = 'videoPlayer'+id;
videoObject.append('<div id='+id+'></div>');

jwplayer(id).setup({
flashplayer: "/_javascript/jwplayer/jwplayer.flash.swf",
file: videoUrl,
width: videoWidth,
height: videoHeight,
stretching: 'uniform',
bufferlength:0,
events: {
onPlay:onVideoPlay
}
})//.play();
}
})
}


Even with the most basic embed bc.. jwplayer(id).setup({flashplayer: "/_javascript/jwplayer/jwplayer.flash.swf", file: videoUrl)} it crashes.


Any idea how this is possible?

Kind regards,

Edwin Veldhuizen

13 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

Hm, do you get the error on a basic embed like this?

http://www.longtailvideo.com/jw-player/

JW Player

User  
0 rated :

No, it's not a device- but a site-specific situation that's why I don't get what's going on.
On all other browsers it works fine and If comment the JWplayer-setup out it's all fine too on iOS.

Tested it on iPhone 5, iPhone 4S and iPad

JW Player

User  
0 rated :

I made an static-html with only jQuery and the JWplayer where the problem occurs:
http://www.facecolor.cc/player2.html

Ethan Feldman

JW Player Support Agent  
0 rated :

What happens if you just use the player, nothing else?

JW Player

User  
0 rated :

Hi Ethan,

Thanks for commenting.. It's a pretty specific situation, but I work with dynamically loaded pages with multiple video's. As you can see in the player2.html it's very straight-forward, no weird code or frameworks. Just a few lines which work on all browser and in theory on iOS too, but the player let's iOS crash. Did you even check the source?

The reason why I report it here is because it's a bug. Embedding works fine, because it works on Safari, Chrome, IE7, IE8, IE9, Firefox. If it was a mistake in the code it wouldn't have worked there.

JW Player

User  
0 rated :

I can confirm your test page crashes on my ipad2/iOS6 as well. and I have the same situation in my project, using the most recent jwplayer :-/ Did you find out what it was ?

Theres indeed nothing weird about your source. The dynamic div by itself doesnt make it crash either - you could take that out of the test - and the key :-) - and the flash player, because that is nt being used by the ipad. jQuery 1.9 by itself is no problem.

I'm tempted to think its just something in the css, could that be ?

Its a serious problem imho .. as it stands I will have to do browser sniffing and insert html5 code instead of jwplayer on the ipad.

*-pike

JW Player

User  
0 rated :

Hm, thats obscure (mumble,mumble).

Edwin, could try remove the -webkit-overflow-scrolling: touch;
statements from http://www.facecolor.cc/_css/algemeen.css?1365594175

I had it on a container div for the player, and as soon as i setup() the player, bang, gone is safari. Is that your problem, too ?

*-pike

JW Player

User  
0 rated :

indeed, all i had to add to fix it sitewide, was

.jwplayer { -webkit-overflow-scrolling: auto; }

.. since jwplayer adds that class for the html5 player itself, and the ipad only uses that player.

$2c,
*-pike

Ethan Feldman

JW Player Support Agent  
0 rated :

@Edwin – I indeed looked at the source, and saw that issue. The reason I wanted something really bare bones was because the crash doesn’t happen in that case. Here either – http://www.longtailvideo.com/jw-player/download/

@pike – Thank you for sharing this.

JW Player

User  
0 rated :

@pike thanks for this solution, it works :)

Ethan Feldman

JW Player Support Agent  
0 rated :

Nice :)

JW Player

User  
0 rated :

@ethan .. you might want to put that in the jwplayer code somewhere ? doesnt hurt anyone and stops the ipad from crashing .. even though it is obviously an ipad bug ..

.jwplayer { -webkit-overflow-scrolling: auto!important; }

Ethan Feldman

JW Player Support Agent  
0 rated :

Yes, I will pass thing along, I think I already have, but I will again just in case :D

This question has received the maximum number of answers.