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

Forums

/

OVA + Flowplayer + HD Switch = Black Screen (Audio Only)

15 replies [Last post]
Reply

Hi,

i'm currently getting an strange error when switching the current clip to HD. Setups worked since months without any problems - until i've implemented the OVA Plugin.

Code:

$('#placeholder').addClass('noerror').animate({height: '375'});
var initialLoad = true;
var prevTime;
var preVol;

var HDStream = {
    'autoPlay': true,
    'autoBuffering': false,
    'url': 'http://www.hardwareclips.com:8080/405a31b06b9ece50772e9c4d9f04826d/1272_full.flv',
    'scaling': 'fit',
    'width': '1280',
    'bitrate': '1500',
    'label': 'HD'
};

var SDStream = {
    'autoPlay': true,
    'autoBuffering': false,
    'url': 'http://www.hardwareclips.com:8080/405a31b06b9ece50772e9c4d9f04826d/1272.flv',
    'scaling': 'scale',
    'width': '800',
    'bitrate': '1500',
    'label': 'SD'
};

function toggleHD(currentPos, currentVol){
    prevTime = currentPos;
    preVol = currentVol;
    initialLoad = false;

    if (playhd == true){
        $f().getPlugin('hdon').show();
        $f().getPlugin('hdoff').hide();
        $f('player').play(HDStream);
    } else {
        $f().getPlugin('hdon').hide();
        $f().getPlugin('hdoff').show();
        $f('player').play(SDStream);
    }
}

flowplayer('player', '/flowplayer/flowplayer.commercial-3.2.5.swf', {
onLoad: function(){
$f().getPlugin('hdon').hide();
},
onStart: function() {
if(initialLoad != true) {
this.seek(prevTime);
this.setVolume(preVol);
}
},
'playlist': [{
'url': '/thumb/embed/1272.jpg?1301049408',
'scaling': 'scale'
},
SDStream
],
'plugins':{
'hdoff': {
'url': '/flowplayer/flowplayer.content-3.2.0.swf',
'top': '10',
'left': '15',
'height': '50',
'padding': '0',
'borderRadius': '0',
'width': '42',
'backgroundColor': 'transparent',
'opacity': '0.9',
'border': '0',
'html': '<a href="javascript:void();"><img src="/images/flowplayer/hd_off.png" hspace="0" /></a>',
'backgroundGradient': 'none',
onClick: function() {
    playhd = true;
    var currentPos;
    var currentVol;
    currentPos = $f('player').getTime();
    currentVol = $f('player').getVolume();
    toggleHD(currentPos, currentVol);
}
},
'hdon': {
'url': '/flowplayer/flowplayer.content-3.2.0.swf',
'top': '10',
'left': '15',
'height': '50',
'padding': '0',
'borderRadius': '0',
'width': '42',
'backgroundColor': 'transparent',
'opacity': '0.9',
'border': '0',
'html': '<a href="javascript:void();"><img src="/images/flowplayer/hd_on.png" hspace="0" /></a>',
'backgroundGradient': 'none',
onClick: function() {
    playhd = false;
    var currentPos;
    var currentVol;
    currentPos = $f('player').getTime();
    currentVol = $f('player').getVolume();
    toggleHD(currentPos, currentVol);
}
},
'ova': {
'url': '/flowplayer/flowplayer.ova.swf',
'autoPlay': true,
'ads': {
'playOnce': true,
'pauseOnClickThrough': false,
'companions': [
{
'id': 'companion',
'width': '300',
'height': '250'
}
],
'servers': [
{
'type': 'OpenX',
'apiAddress': 'http://openx.digital-natives.de/delivery/fc.php'
}
],
'schedule': [
{
'position': 'pre-roll',
'zone': '1',
'playOnce': true
},
{
'position': 'post-roll',
'zone': '3',
'playOnce': true
}
]
}
},
'lighttpd': {
'url': '/flowplayer/flowplayer.pseudostreaming-3.2.5.swf'
}
},
'clip':{
'provider': 'lighttpd',
'autoPlay': true,
'autoBuffering': false
}
});

When clicking the hd button flowplayer switches to the other file but no video is displayed - all i get ist a blank player with the audio file of it. tried to disable metadata with "metaData: false" and then its workung but pseudostreaming doesn't - so i'm unable to seek

Firebug sais:

11:37:51 GMT+0100: This clip is not an ad so we aren't doing anything with this duration metadata
11:37:53 GMT+0100: MetaData received for active clip - duration is 116.64
Reply

Hi...

Looking into this for you.. one thing I noticed that has me a little confused so I thought I'd ask first...

I looked on your production site to see it happening - looked at the first video "NVIDIA GeForce GTX 590 - Tom Petersen"

Ad plays, then the main video (non HD) - switched to HD - switches - ad plays and then the main clip plays in HD (see and hear both).

Also tried "Nintendo 3DS - Pilotwings Resort Freiflug-Modus Test [HD]" and it seems to work well too... pseudo-streaming also seems ok.

So I'm wondering - do you consistently see this in all your videos or just a specific/some of them?

Would you have a URL setup that I could look at to see it happening?

Paul

Reply

i've changed the behavior of the hd button on the production site as its live and an black screen with sound is out of question. prior to this we had an hd button which dynamically loads (without reload of the whole page) the hd clip via javascript.

for an live demo take a look at this:
http://old.hardwareclips.com/video/1272/AMD-HD-6970-von-Sapphire--CasekingTV

(development server)

thanks a lot for your afford!

Reply

Ah.. gotcha.. thanks...

Looking into it.. just one thing though - trying that old.hardwareclips.com URL I get the following message come up:

"Ein Problem Ist Aufgetreten. Sie mussen Javascript und den....."

Any ideas?

Paul

Reply

have you installed the firebug addon for firefox? I'm currently using the console.log option for debugging ...

Reply

Yeh, running Firebug.. i'll try running the URL in Chrome to avoid Firebug...

Reply

and? :)

Reply

I can see the problem... still trying to get to the bottom of it...

Paul

Reply

Hi... so looking at this in a lot more detail, can I ask - what are you actually expecting to see happen when someone presses the HD button during an ad?

Right now, the way your script is setup, it starts playing the show stream. I have that working now properly it seems, but it doesn't really make sense.

Doesn't it make more sense to have the HD button disabled during ad playback?

Are you interested in knowing how to do that?

Paul

Reply

Hi Paul,

yeah - the HD button is supposed to be disabled during an ad. But after the ad it should switch the stream from SD to HD.

Would be great if you could provide me with additonal info and/or snippet-code :)

Reply

to avoid misunderstandings:
i'm expecting nothing when the hd button is pressred during an ad ... the problem ist: AFTER the ad (when the clip is played) the hd button causes an black screen with audio only (if i disable the ova plugin everthing works fine ...)

Reply

Ok, but you'll have to change your code to stop the hd button doing something when an ad plays. When an ad plays, the hd button is available and enabled. When you hit it, it tries to load the HD version of the show clip (which is does successfully and starts playing it properly). Clearly that's not good.

So when an ad is active, you'll need to disable the hd button so pressing it does nothing.

I'll setup a test page for you that has everything working properly (and show you how to detect an ad playing and disable that button).

Also, just to be clear, on the test page I'm using here, the stream plays perfectly in all cases so perhaps it's a version issue. Seems like the case....

Let me get the test page up for you and then we can move forward from there..

Paul

Reply

Hi.. just a quick update on this - I've got the demo working - I'm just holding on posting it for 24 hours or so until I test/checkin the latest code. Since the example points to the latest version of the SWF, I thought I best post it with the latest code base so you can use both at the same time...

Hold tight - having just a small issue around VAST wrappers that I need to clear before checking in the code and posting the example with the HD button working properly...

Paul

Reply

Hi,

Very sorry for the extended delay posting this. The VAST wrapper issue that was stopping me from checking in the latest code took a long time to resolve.

Anyway, I've posted a working version of your setup here:

http://static.openvideoads.org/support/simplyray/hd-on-off.html

This version uses the latest OVA development build so it's probably best to make sure you are running that as well. Grab that from http://developer.longtailvideo.com/ova - register on the site and grab the latest development release from the Download the Latest page.

The version should be: OVA for Flowplayer - v0.6.0 RC3 (build 123)

A couple of interesting things about this example:

1. Detecting OVA ads. I enable/disable your HD button using the following Javascript:

onStart: function(clip) {
if(clip.ovaAd == true) {
    $f().getPlugin('hdon').hide();
    $f().getPlugin('hdoff').hide();
}
else {
if(playhd == true) {
    $f().getPlugin('hdon').show();
       $f().getPlugin('hdoff').hide();
}
else {
       $f().getPlugin('hdon').hide();
       $f().getPlugin('hdoff').show();
}
if(initialLoad != true) {
this.seek(prevTime);
this.setVolume(preVol);
}
}
},

For OVA ads, a property called "ovaAd" will be set to "true". You can use that to determine when an OVA scheduled ad is playing.

2. Javascript callbacks - OVA also supports a range of Javascript callbacks on the start and end of ads etc. You can see the functions in that example:

function onLinearAdStart(ad) {
    console.log(">>> Linear ad start");
}

function onLinearAdFinish(ad) {
    console.log(">>> Linear ad end");
}

For more info on the Javascript callbacks and OVA clip properties, have a look at the RC3 releases notes on the OVA developer site (sections 17 and 22):

http://developer.longtailvideo.com/ova/wiki/OvaRCNotes-011211-3

The switching between HD and non-HD seems to work.

On strange thing I noticed though. Sometimes it plays on fast forward when switching between HD/normal… not sure why it does that - OVA is definitely not impacting that. I'm confident about that because I took OVA out of the config and the standard playback did that. It must be something related to the Flowplayer pseudo-streaming (at a guess).

Anyway, let me know how you get on with this ...

Paul

Reply

Hi Paul,

just checked your example and the latest ova plugin. thanks a lot! (just discovered the skip-ad-button & ga-plugin)

just one problem: in your example after clicking the hd-button the sound is gone?

Reply

Yeh I noticed that too - but that's not OVA doing that. I removed OVA completely and ran the example - it did the same thing... both the fast forward and the sound going seem to be a Flowplayer pseudo-streaming issue..

100% positive it's not OVA causing the issue ;)

Have you tried posting something to the Flowplayer forum to see if others experience the same thing?

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