Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Memory issues with OVA an JWPlayer

22 replies [Last post]
Reply

Hey everyone.

I have some pretty basic code:
[code]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="js/jwplayer.js"></script>
<style type="text/css">
#frame{ height:270px; width:480px;}
#controls{ background:#003366; border:#BBBBBB 2px solid; padding:3px 10px;}
.control{border:2px solid #777777; height:20px; width:100px;}
.db{display:block}
.dib{display:inline-block;}
</style>
<title>JWPlayer Demo</title>

<script type="text/javascript"> //Executed at launch
var vidPlayer=null;
function tcu(){
jwplayer().stop()
jwplayer().remove();
vidPlayer=null
setTimeout(function(){djp();}, 500);
}
function djp(){
rightNow= new Date();
vidPlayer=jwplayer("frame").setup({ //jwplayer setup
allowScriptAccess:'always',
"controlbar.position":"bottom",
flashplayer: "http://www.filemobile.com/static/videoplayer/player.swf",
file: "http://bb.c/mp5.8/video.mp4",
height: 270,
//"ova.json" : "{ "debug": { "debugger": "firebug","levels": "fatal, config, vast_template" },"overlays":{"closeButton": {"type": "custom","image":"http://www.theweathernetwork.com/common/images/global/mylocationdelete.png","width":16,"height":16},"regions":[{"id":"bottom","verticalAlign":"bottom","horizontalAlign":"center","backgroundColor":"#000000","padding":"-10 -10 -10 -10","width":480,"height":60}]},"ads": { "pauseOnClickThrough": true, "schedule": [ { "zone": "5","position": "pre-roll", "server":{ "type": "AdTech","apiAddress": "http://adserver.adtechus.com/?advideo/3.0/5152.1/123456/0/-1/cc=2;vidas=pre_roll;vidlen=;vidbr=;vidr..."+rightNow.getTime() +"" } }, { "zone": "5","position": "post-roll", "server":{ "type": "AdTech","apiAddress": "http://adserver.adtechus.com/?advideo/3.0/5152.1/123456/0/-1/cc=2;vidas=post_roll;vidlen=;vidbr=;vid..."}},{ "position": "bottom","starttime": "00:00:03","duration": "15", "server":{ "type": "AdTech","apiAddress": "http://adserver.adtechus.com/?advideo/3.0/5152.1/123456/0/-1/cc=2;vidas=post_roll;vidlen=;vidbr=;vid..." }, } ] } } }",
//plugins:{'http://filemobile.com/static/videoplayer/ova.swf' : {},},
skin:"http://www.filemobile.com/static/videoplayer/filemobileSkin.zip",
width: 480,
wmode:"transparent"
});
}
$(document).ready(function(){ //jQuery launch code
djp();
//Controls setup
$('#c1').mouseup(function(){
tcu();
});
//End controls setup
}); //end jQuery launch Code
</script> <!-- End Launch js -->
</head>
<body>
<div id="frame"><div id="container"></div></div>
<div id="controls">
<div id="c1" class="control dib"></div>
</div>
</body>
</html>
[/code]

This code should cause the button to remove the player and draw a new instance. Typically, it works with a small amount of memory usage. However, if I uncomment the ova.json and plugins properties of the setup object, it causes the IE9 memory usage to skyrocket. Stopping/removing the player no longer releases the player from memory and a couple refreshes can cause the application to crash.

I am doing this because I need to use a new ova.json for each video played (There will eventually be numerous videos to choose from). If I knew how to alter that at runtime, I'd use it in parallel with jwplaer().load in the hopes that that could curb resource usage. Unfortunately, reloading the page and pulling the relevant video information from the URL is not an option

Can anyone help me get memory usage under control while using the ova plugin?

Reply

Reposting the code properly formatted:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="js/jwplayer.js"></script>
<style type="text/css">
#frame{ height:270px; width:480px;}
#controls{ background:#003366; border:#BBBBBB 2px solid; padding:3px 10px;}
.control{border:2px solid #777777; height:20px; width:100px;}
.db{display:block}
.dib{display:inline-block;}
</style>
<title>JWPlayer Demo</title>

<script type="text/javascript"> //Executed at launch
var vidPlayer=null;
function tcu(){
jwplayer().stop()
jwplayer().remove();
vidPlayer=null
setTimeout(function(){djp();}, 500);
}
function djp(){
rightNow= new Date();
vidPlayer=jwplayer("frame").setup({ //jwplayer setup
allowScriptAccess:'always',
"controlbar.position":"bottom",
flashplayer: "http://www.filemobile.com/static/videoplayer/player.swf",
file: "http://bb.c/mp5.8/video.mp4",
height: 270,
//"ova.json" : "{ "debug": { "debugger": "firebug","levels": "fatal, config, vast_template" },"overlays":{"closeButton": {"type": "custom","image":"http://www.theweathernetwork.com/common/images/global/mylocationdelete.png","width":16,"height":16},"regions":[{"id":"bottom","verticalAlign":"bottom","horizontalAlign":"center","backgroundColor":"#000000","padding":"-10 -10 -10 -10","width":480,"height":60}]},"ads": { "pauseOnClickThrough": true, "schedule": [ { "zone": "5","position": "pre-roll", "server":{ "type": "AdTech","apiAddress": "http://adserver.adtechus.com/?advideo/3.0/5152.1/123456/0/-1/cc=2;vidas=pre_roll;vidlen=;vidbr=;vidr..."+rightNow.getTime() +"" } }, { "zone": "5","position": "post-roll", "server":{ "type": "AdTech","apiAddress": "http://adserver.adtechus.com/?advideo/3.0/5152.1/123456/0/-1/cc=2;vidas=post_roll;vidlen=;vidbr=;vid..."}},{ "position": "bottom","starttime": "00:00:03","duration": "15", "server":{ "type": "AdTech","apiAddress": "http://adserver.adtechus.com/?advideo/3.0/5152.1/123456/0/-1/cc=2;vidas=post_roll;vidlen=;vidbr=;vid..." }, } ] } } }",
//plugins:{'http://filemobile.com/static/videoplayer/ova.swf' : {},},
skin:"http://www.filemobile.com/static/videoplayer/filemobileSkin.zip",
width: 480,
wmode:"transparent"
});
}
$(document).ready(function(){ //jQuery launch code
djp();
//Controls setup
$('#c1').mouseup(function(){
tcu();
});
//End controls setup
}); //end jQuery launch Code
</script> <!-- End Launch js -->
</head>
<body>
<div id="frame"><div id="container"></div></div>
<div id="controls">
<div id="c1" class="control dib"></div>
</div>
</body>
</html>

Reply

Hi,

Can I start off by asking - which version (number) of OVA are you running? (you'll see the version number printed out in the Javascript console)...

Paul

Reply

Here's the output from my console
11:29:32 GMT-0500 Debuggable: Debug level has been set to 1088
11:29:32 GMT-0500 Debuggable: OVA for JW 5.x - v0.5.0 RC3 (build 252) - player is 5.3.1397 (Licensed version)

I had to remove the debug and overlay properties from my ova.json object to get it to function properly but that had no effect on my memory issue

Reply

Hi, thanks for that... and which Flash version?

Just wondering - have you tried running JW5.7 or JW5.8 and the latest OVA version (RC6) or even RC5?

I'm also wondering if the Javascript callbacks are increasing browser memory usage.

Is there anyway that you could setup to run JW5.7 or JW5.8 and RC6 - if you can do that, then I can try playing with some options and see if it helps - and you can point to my latest development version to check... ?

Paul

Reply

Flash version is 11.1.102.55

Unfortunately the player and ova versions are provided to me by my client. I'm not wildly familiar with the player and plugin but my perception is that they paid for these versions so that's what they're going with. To add to the complications, this product will not be deployed in a browser but through a shell application that incorporates the functionality of Internet Explorer

The callbacks may be having a small effect on memory usage but in Chrome/Firefox, resources are handled quite nicely. This problem is only in IE.

Reply

Oops, just wanted to add that I have tried the most updated player with no change in behaviour. I was not aware that I could use an updated version of OVA. Can I download it somewhere?

Reply

Hi,

You can grab the very latest release of the OVA plugin from the OVA Developer Site - http://developer.longtailvideo.com/ova - register on there and then grab RC6 or the RC6 development release from the "Download the Latest" page...

It's a free upgrade, so grab the latest for sure.

I doubt it will fix the problem though.

When do you see the memory usage spike - on load, or during it's operation?

Paul

Reply

I get a small jump on load and more on operation. My problem is that when I stop and remove the player, the memory is not freed up. Thus, it simply adds to the resources used for the player and video when the player is redrawn.

If I comment out the plugin info, the memory is cleaned up as expected in all browsers.

I'll try the new OVA version and report here

Reply

So I suppose the key question is - why isn't the memory being freed up when the player is being removed. We'll need to do some investigation to track that down. It's going to take a bit of time.. I can do it over the next 72 hours (unfortunately I can't track it down today but I can get onto it Friday and over the weekend).... if that timing is ok for you...

Paul

Reply

PS: When you setup your player using 5.8 and RC5 or RC6, you can put the config straight into the embedded JSON format now rather than use the messy ova.json String. While that doesn't help your memory problem, it may make your life a bit easier...

See this example:

http://static.openvideoads.org/qa/latest-qa-rc/ova.jwplayer.5x/examples/pages/setup/jw-embedder.html

Paul

Reply

Cool, I really appreciate the help. Anytime this week or next would be fine. Also, thanks for the heads up about the newer versions supporting JSON objects. Editing that string can get extremely tedious so this will help a lot.

Reply

Sure - no problem at all. Ok, it's now officially on my TO DO list and to be honest, I'm a bit worried that it's happening so I'll look at it with priority in the next 3 days or so. If you need to prod me on it, do so either on this forum thread or email us via enquiries@openvideoads.org and you'll hit me directly ;)

I suspect this is going to take some serious digging to track down...

Paul

Reply

If it's helpful, I found a temporary work around so there's less of a rush. I was able to implement a page reload for each video so that memory is freed by the browser. It's not an ideal solution so if you find something useful, I'd still appreciate it :)

Reply

Any luck tracking down this issue? My temporary fix is working ok but I'd love to get the player and plugin working as originally intended :)

Reply

Hi,

Sorry on the delay responding. I haven't gotten to the bottom of it yet - it's proving tough to track down/sort...

Paul

Reply

In the meantime, maybe you can help me with an issue that has surfaced with my band-aid.

I was able to implement a page load that will help with my memory issues. However, video does not always load in the player. I've traced the non-loading to pages that have encoded special characters in the URL/query string.
(EX: http://bb.local/wx5/main_en.html?lang=EN&placecode=CAQC0363&visitorID=2BA42AD3F90749D3861624D463E6FC... )

See how the query string variable cityName has an encoded acute accented e(Montr%E9al)? If I hardcore that value with no accent, the player works ok. However, the pressence of the accent stops the player from loading anything at all (thumbnail, ads or video). If I remove the ova plugin or plugin config, the player works fine (thumb/vid).

Is there something in the ova pluging that breaks if using accented characters in the URL? I have tried the player/OvA versions mentioned above as well as the most recent versions with no success

Here is my code:

var jsonstr="{ "debug": { "debugger": "firebug","levels": "fatal, config, vast_template" },"overlays":{"closeButton": {"type": "custom","image":"http://www.theweathernetwork.com/common/images/global/mylocationdelete.png","width":16,"height":16},"regions":[{"id":"bottom","verticalAlign":"bottom","horizontalAlign":"center","backgroundColor":"#000000","padding":"-10 -10 -10 -10","width":470,"height":60}]},"ads": { "pauseOnClickThrough": true, "schedule": [ { "zone": "5","position": "pre-roll", "server":{ "type": "direct","apiAddress": "http://adserver.adtechus.com/?advideo/3.0/5152.1/123456/0/-1/cc=2;vidas=pre_roll;vidlen=;vidbr=;vidrt=vast;vidrtv=2.0;alias="+valias+"" } }, { "zone": "5","position": "post-roll", "server":{ "type": "direct","apiAddress": "http://adserver.adtechus.com/?advideo/3.0/5152.1/123456/0/-1/cc=2;vidas=post_roll;vidlen=;vidbr=;vidrt=vast;vidrtv=2.0;alias="+valias+""}},{ "position": "bottom","starttime": "00:00:03","duration": "15", "server":{ "type": "direct","apiAddress": "http://adserver.adtechus.com/?advideo/3.0/5152.1/123456/0/-1/cc=2;vidas=overlay;vidlen=20;vidbr=;vidrt=vast;vidrtv=2.0;alias="+valias+"" } } ] } } }";
setTimeout(function(){
if($('#loadingAnim').css('display')!='none'){
$('#loadingAnim').hide();
}
vidPlayer=jwplayer("mediaspot").setup({ //jwplayer setup
//allowScriptAccess:"always",
autostart:false,
"controlbar.position":"bottom",
flashplayer: "http://www.filemobile.com/static/videoplayer/player.swf",
file: vurl,
fmchannel:0,
"fmrelatedplugin.navigateurl":"http://damocles.theweathernetwork.com/your_weather/details/__CHANNEL__/__ID__/20/upload/",
"fmrelatedplugin.titlestring":"Related Videos",
height: 259,
image:turl,
"ova.json" : jsonstr,
plugins:{
'http://filemobile.com/static/videoplayer/ova.swf' : {},
'http://filemobile.com/static/videoplayer/fmrelatedplugin.swf':{},
'http://filemobile.com/static/videoplayer/fmplaytimetracking.swf':{}
},
provider:'video',
skin:"http://www.filemobile.com/static/videoplayer/filemobileSkin.zip",
width: 450,
wmode:"transparent"
}); //End jwplayer setrup
jwplayer('mediaspot').onPlay(function() {
//Keep alive if user is watching video
if(vidActivityTimer==null){
external.OnUserActivity(19);
vidActivityTimer=setInterval(function(){
external.OnUserActivity(19);
}, 5000);
}
});
jwplayer('mediaspot').onPause(function() {
clearInterval(vidActivityTimer);
vidActivityTimer=null; //Kill keepAlive timer
});
jwplayer('mediaspot').onComplete(function() {
clearInterval(vidActivityTimer);
vidActivityTimer=null; //Kill keepAlive timer
});
}, 500);
Reply

Hi,

I'm not sure I follow 100% - I can't see the accented character in your config above and am not sure of the relationship between the URL with the accent and the config.. but having a guess...

My guess is that it's the JSON parser in OVA (the adobe one) and URL encoding of the variable in and out of the plugin by the player, but it's a guess.

You should really not use the "ova.json" variable anyway with the JW Embedder as it's a waste of additional parsing within OVA that you can avoid by embedding the OVA config directly in JSON form - e.g. as per this setup:

http://static.openvideoads.org/qa/latest/ova.jwplayer.5x/examples/pages/setup/jw-embedder.html

So I'd config OVA as follows:

plugins: {
     "http://filemobile.com/static/videoplayer/ova.swf": {
             // put your OVA config directly in here in JSON form
     }
}

Then, when the accent has to be specified in the config, put it in unencoded form.

Here's an example that has an accent in the OVA config:

http://static.openvideoads.org/qa/latest/ova.jwplayer.5x/examples/pages/ad-notice/example01.html

and the config as an external config file:

http://static.openvideoads.org/qa/latest/ova.jwplayer.5x/examples/config/ad-notice/ova01.xml

Notice how the accented character isn't encoded when specified in the config...

I'd try that - use the JSON based JW Embedder config and then put the accent in without encoding it...

Paul

Reply

I see what you're saying.

To clarify, the accented character is part of the query string on the page where the player appears. It is not part of the the preroll or plugin URLs.

I'm also not passing the accented character into either the jwplayer setup parameters or the ova.json object. That's the strange part to me and why I thought the ova plugin might reference the url through javascript (ala window.location).

Can I use the json embedding with old version of the player and OVA plugin I am using? (11:29:32 GMT-0500 Debuggable: OVA for JW 5.x - v0.5.0 RC3 (build 252) - player is 5.3.1397 (Licensed version))

Reply

Really strange.. the only time that OVA ever makes a callout to get "window.location" is when the "__page-url__" etc. type variables are used in the ad tag, but that doesn't seem to be the case with your config.

But even if it was making that call, I can't see how the accent in the URL would break OVA.

Something doesn't add up - but I can't put my finger on it.

Do you have a public URL that I could play with? I'd like to see what the OVA debug is saying... if you don't perhaps you could send me the full debug dump from the Javascript console (email enquiries@openvideoads.org) - I may be able to spot something in it.

Make sure you have the debug levels set to 'config, fatal, vast_template, api, javascript, http_calls" if you send it..

The embedding approach won't work with JW5.3 and OVA - JW5.3 didn't support the deep, nested JSON config from memory - that really only works properly with JW5.6 on (from memory)....

Paul

Reply

I don't exactly have a public-facing website. The page is actually a desktop app inside a web-enabled shell that mimics Internet Explorer. I can give you the beta installer we've been testing if you have an email address.

I'm sure the shell isn't the problem since video plays well in the majority of the cases. Only when the user selects a city with accents (Montreal, Quebec City), I see this issue.

Reply

Sorry...answered my own question and sent the beta link to the email you listed above. Let me know if you need anything further?

Reply

Great - thanks - got it.. will check it out and see what i can find.. intrigued.. definitely sounds like a strange one...

Paul

Post new comment

  • Allowed HTML tags: <code> <blockquote> <em> <strong> <strike> <ul> <li> <ol>
  • You may post code using <code>...</code> .
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options