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

Problem removing player - 'SetReturnValue': object is null or undefined - jw6


We are building a new streaming portal as an ajax app (no page reloading) and when removing the player with a simple jwplayer().remove() (when page shifting etc.) IE 8/9 throws an

*SCRIPT5007: Unable to get value of the property 'SetReturnValue': object is null or undefined*

in an endless loop.

The funny thing is that the player needs to be playing for this to happen. I have therefor tried to call .stop() before .remove(), this takes care of the inifite loop but not the error. I do not have an external example but I think that my issue is the same as reported here:

http://www.longtailvideo.com/support/forums/jw-player/javascript-interaction/19788/replacementremoval-of-video/

and lately here:

http://www.longtailvideo.com/support/forums/jw-player/javascript-interaction/32138/endless-javascript-error-loop-when-flash-player-is-removed-from-dom/

we can use the test link and procedure from this last post above to reproduce the same error as I am getting at our site:

http://www.domradio.de/?testjwplayer

I experience the endless loop when following these steps:

1) Go to http://www.domradio.de/?testjwplayer with IE8
2) Click the video thumbnail below 'Nachrichten-Video'
3) Let the video play for a bit.
4) Close the popup
--> The IE status bar will show a Javascript error.
5) Open the IE javascript error console. It will show a certain number of errors.
6) Close and re-open the error console. It will show more errors.

I am using JW 6.4 pro. I would greatly appreciate some advice working around this problem.

The posts above are both locked so I was unable to post my issue there.

Best,
Joern




12 Community Answers

JW Player

User  
0 rated :

@Joern

Grusse aus Bad Salzuflen

Ich werde auf Englisch fortsetzen, so dass andere auch Vorteil haben knnen.
Ich wrde lieben, an Ihrem Projekt zu arbeiten. Ich bin verfgbar

The error message *SCRIPT:5007* is not an issue of the JWPlayer BUT reflective of an error created via a library when rendered with/in IE8.

I would apply or install the following and as close as possible to the top of the document perhaps just after the declaration of the character encoding.

From a performance point of view, I would change several things such that it will render more efficiently.
bc.. <meta http-equiv="X-UA-Compatible" content="IE=8;FF=3;OtherUA=4" />



This would force rendering of the page as optimized for IE8 when IE8 is used; *you will of course need to change the remaining parameters to suit your needs or requirements.*

It should solve your issue at hand "provided" there isn't any additional issues at hand.

I would highly recommend that use attempt not to use <=IE8 and should a visitor visit with <=IE8 then have a message appear to them.

I purposely exclude IE from access to my web site which is written in html5 by virtue in their lack of support for HTML5 and CSS3 animations. IE is in fact 'internet exploder'.

visit my web site at www.starbase-alpha.com which contains examples for the JWP5 and JWP6 versions

JW Player

User  
0 rated :

@Willie: Thank you very much for responding

I suspected that this is not a jwplayer issue pr. se but something to do with IE and flash embedding in general. I can find a few other posts on the web in relation to this error and object embedding.

On my site a have this set to use the latest rendering engines

bc.. <meta content="IE=edge" http-equiv="X-UA-Compatible">


and it does not make any difference.

Any other suggestions towards clarifying the problem/a solution?

All help is appreciated.

JW Player

User  
0 rated :

try the suggestion I posted above and let's see what that will bring.

Ethan Feldman

JW Player Support Agent  
0 rated :

Maybe this ticket is relevant to your issue?

http://developer.longtailvideo.com/trac/ticket/1893

Ethan Feldman

JW Player Support Agent  
0 rated :

Do you think that meta tag will solve it?

JW Player

User  
0 rated :

@Willie: I tried it this morning and it forced the browser to render in IE8 as expected but it did not take care of the problem. Still the setReturnValue error both in ie9 and ie8 (both rendering in ie8 mode due to the meta tag.)

@Ethan: I looked at the ticket but I don't think the issue is related. Our page does not reload and the player is not embedded in a form tag. The meta tag did not solve it for me.

On my page the error is not consistent as it is on the linked demo page but turns up once in a while when unloading/removing the player in IE8/IE9 as if it is a timing issue.

If anyone has a working all ajax web app using jwplayer (removing/embedding the player times over without page reload) I would greatly appreciate some guidence.

I have spent many days looking for a solution without luck.

I should mention that when we used the flash version of Flowplayer in a previous version of our site a similar error happened with their unload method but this workaround took care of it:

bc.. $f("*").each(function(k,i) {
try{
swfobject.removeSWF(i.id());
swfobject.removeSWF(i.id()+'_api');
$('#player_wrapper').remove();

}catch(e){}

});



For obvious reasons this code will not work with jwplayer but maybe what this code does is related to this issue and maybe it could point some one to a working solution when removing/unloading jwplayer or other flash objects for that matter.




Ethan Feldman

JW Player Support Agent  
0 rated :

Okay, I had seen a <form> on your page with the JW Player, so I thought it possibly could be related, that’s all.

JW Player

User  
0 rated :

I was able to work around this issue by stopping to use jwplayer().remove() (or jQuery's remove() for that matter) and instead using jQuerys $(player_div).html('') when removing the player and then just re-embedding the same player again as usual when it is needed. I do not now exactly why this works but I suspect that .html('') unlike remove() keeps some references intact that IE8/9 needs in regards to flash objects when they are removed.

Anyway - this takes care of the error in both IE8/9 and his no apparent side effects in other browsers. This if course is not a good way to remove the player and might be prone to memory leaks although it does not look to bad in Chromes profiler.

If anybody finds a better workaround or has a better explanation of the problem please feel free to post it.

Best

JW Player

User  
0 rated :

I am willing to bet that is is an IE(Internet Exploder) issue.

File API for IE is only applicable to/with IE10 thus I bet this could be the issue.

see this http://msdn.microsoft.com/en-us/library/ie/hh673542%28v=vs.85%29.aspx

I notice a couple of other things that may be affecting the issue

1. an outer div
2. an inner div
3. a timeout function wrapped around the jwplayer.

try the following to test things out

1. get rid of the outer div
2. get rid of the timeout function.
It could very well be that the timeout function may be the cause of the issue.

3. then add <meta http-equiv="X-UA-Compatible" content="IE=8 />
to the document

I do notice also that it takes some time to load thus adding overhead to performance.

Ethan Feldman

JW Player Support Agent  
0 rated :

Thanks for sharing the work around Joern !

JW Player

User  
0 rated :

@Willie Thanks for you suggestions. First I need clarify that the link provided to the example in my earlier post is not my site but site which throws a similar error. I have linked to the thread where it is from.

I am currently trying to persuade operations to set up some kind of public demo space or alternatively a non protected stream I can use in the future if I need support. I know a link that demos the problem is a must if you want support.

In regards to your suggestions:

<ul>
<li>I'm not quite sure what you mean with the reference to the IE10 file API</li>
<li>Actually I tried to move the player on my own site to a position without nested divs - I still get the error (without my own workaround)</li>
<li>On my own site a have no timeout wrapped around my player</li>
<li>The meta tag does not get rid of the error as I posted before and it is not applicable in our case because we need both IE8/9 to render with their own engines.</li>
<li>As the link is not to my own site I can not do anything about the performance issue</li>
</ul>

As posted before I have a workaround for now but I am still eager to hear from people with better solutions than mine.

Thank you for your time Willie.

Ethan Feldman

JW Player Support Agent  
0 rated :

I think the work around you provided is quite good for this :)

This question has received the maximum number of answers.