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

Forums

/

Playlist shows wrong video

7 replies [Last post]
Reply

I'm using jwplayer with ova and I’m having a strange behavior:

When I click in the first video of the playlist, it shows me the pre-roll publicity video. When I click the second video in the playlist, it shows the first video, allways video index - 1.

(I've tried to send a url with an example, but the spam filter was triggered, so please remove spaces: www.sporting.pt / tab_videos_dev . asp)

Can you help me?

Thank you,
Pedro Friezas

Reply

I'm using OVA for JW 5.x - v0.5.0 RC5 (build 50) - player is 5.8.2011 (Licensed version)

Reply

Hi, sure I can help sort this. Would you mind turning up the debug levels on that test page a bit so I can see more of what's going on?

Could you set the levels to "fatal, config, vast_templates, http_calls, playlist"

Thanks...

Paul

Reply

Hi Paul, the debug level of the OVA is now as you told me.

Thank you,
Pedro

Reply

Hi,

Thanks Pedro - that really helps.

Ok, it's a little tricky to work out exactly what's going on with your setup because of all the embedded minimised Javascript and back-tracing to see exactly what you are doing, but can I first check that I understand what you are doing here:

1. You've built a playlist and have loaded that into the player via the "file" flashvar in the OVA config - so 5 clips are loaded up when the player loads

2. You've then built (via Javascript) a playlist controller so that you click on one of the images and then you expect that clip to load and only a pre-roll if it's the first item in that playlist?

3. But what I can't easily see is how are you triggering the load of the clip from the Javascript playlist? I am certain that the issue is there.

My feeling is that there are a couple of things here:

1. Mixing up the different load models for OVA - I think if you are doing things via Javascript, you shouldn't load the full playlist via OVA config and a single call to load the full playlist into the player - I think you should rather control loading via the Javascript clip item at a time. For example:

http://static.openvideoads.org/qa/latest/ova.jwplayer.5x/examples/pages/javascript/example2.00.00.ht...

If you do that, then you have to call an OVA interface to trigger OVA to load up the clip and schedule an ad if required.

2. Run RC7 - for safety, upgrade to RC7 from the OVA developer site so we can be sure that it's not a bug somewhere (I'm pretty sure it's not)

Anyway, if we could start with you explaining a little more about how your setup works, we can isolate the exact problem, but I'm confident it's a conflict between the way you've implemented it and the way OVA is expecting to work with your current options...

Paul

Reply

First of all, my apologies for my lousy English;
Next I’ll try to explain how I’m configuring my player:

This is my OVA configuration:

        var jwp_pub = {
            "http://stc.datamediacenter.com/swf/jwplayer/ova.swf": {
                blockuntiloriginalplaylistloaded: true,
                    allowPlaylistControl: true,
                    ads: {
                        notice: {
                            show: true,
                            textStyle: "smalltext",
                            type: "countdown",
                            message: "PUB | _countdown_"
                        },
                        servers: [{
                            type: "direct",
                            tag: "http://pub.sapo.pt/vast.php?zoneid=881&charset=UTF-8&kw=&d=&cb=8347348737"
                        }],
                        clickSign: {
                            enabled: true,
                            verticalAlign: "center",
                            horizontalAlign: "center",
                            width: 250,
                            height: 32,
                            opacity: 0.5,
                            borderRadius: 20,
                            backgroundColor: "#000000",
                            style: ".smalltext { font-size:12; }",
                            html: "<p class='smalltext' align='center'>OBTENHA MAIS INFORMAÇÃO</p>",
                            scaleRate: 0.75
                        },
                        schedule: [{
                            position: "pre-roll",
                            applyToParts: [0]
                        }],
                                        debug: {
                                                levels: "fatal, config, vast_templates, http_calls, playlist",
                                                "debugger": "firebug"
                                        }
                    }

My player configuration:

        jwplayer(mplaynn).setup({
                'flashplayer': 'http://vdo.datamediacenter.com/jwplayer/player.swf',
                'width': dataconf.vd.width, 'height': vdh,
                'autostart': false,
                'repeat': 'list',

                'allowPlaylistControl': true,
                'playlistfile': 'http://vdo.datamediacenter.com/mrss/scp/playlist-homepage.xml',

                "controlbar.position": dataconf.cntl.hide ? "over" : "bottom",
                "controlbar.idlehide": dataconf.cntl.hide ? true : false,
                "controlbar.margin": 0,
                'backcolor': dataconf.cntl.backcolor,
                'frontcolor': dataconf.cntl.frontcolor,
                'lightcolor': dataconf.cntl.lightcolor,
                'screencolor': dataconf.vd.screencolor,

        'plugins': jwp_pub,
               'events': jwp_events
        }) ;

As you can see, I configure pub video in the OVA plugin, from a VAST server, and my playlist in the jwplayer, from a mrss.

The events declared are used only to change the look of the list:

       var jwp_events = {
                'onReady': function (e) {
                        var mplaynn = 'mediaplayer-'+ dataconf.id.chnl +"-"+ dataconf.id.plynn ;
                        var ply = jwplayer(mplaynn).getPlaylist() ;
                        init_plythumbs (dataconf, divplacer, mplaynn, ply) ;
                },
                'onPlaylistItem': function(e) {
                        var idx_ply = e.index ;

                        var ttss = divplacer.find("li:eq("+ idx_ply +") a").attr('dmctxt').split(' | ') ;
                        divplacer.find("p").html(ttss[0]) ;
                        if (ttss[1])
                                divplacer.find("span").html(ttss[1]) ;
                        divplacer.find("a.on").css('background-color', 'transparent') ;
                        divplacer.find("a").removeClass('on') ;

                        divplacer.find("li:eq("+ idx_ply +") a").addClass('on') ;
                        divplacer.find("li:eq("+ idx_ply +") a").css('background-color',
                                '#'+ dataconf.tb.oncolor) ;
                }
        }

Finally, when a video in the playlist is clicked, the following function is called:

        ull.find("a").click(function() {
                $j(this).css('background-color', '#'+ dataconf.tb.oncolor) ;
                var id = parseInt ($j(this).attr('id').substr(1)) ;

                if (dataconf.spl) {
                        divplacer.find("div.spl").css('z-index', 0) ;
                        divplacer.find("div.spl").css('visibility', 'hidden') ;
                }
                jwplayer(mplaynn).playlistItem(id) ;
        }) ;

My playlist elements have Id's v0, v1, v2, ... , vN
In the example page, there are pub video + 4 videos.
When I click first video in the playlist, the ID is 0, but jwplayer(mplaynn).playlistItem(0) shows pre-roll video, and not the first video in my playlist. This is the place in code where id's don't match.

I've found a workaround adding 1 to var id before calling jwplayer(mplaynn).playlistItem(id), but it will fail if my vast server don't send me any video for any reason.
Is there any way to know in javascript if the OVA has any video configured or not?

I hope I have been clear in my explanation.

Reply

Ok, gotcha... now I understand what you are doing - that's great - thanks for the explanation.

On the question about "knowing if OVA has an ad" - that is possible. You can use the OVA Javascript callbacks to identify if OVA has received any ads.

The key javascript functions are:

onAdSchedulingStarted()
onLinearAdScheduled(ad)
onNonLinearAdScheduled(ad)
onCompanionAdScheduled(divSpecification, companionAd, parentAd)
onAdSchedulingComplete(ads)

So you can go something like this:

function onAdSchedulingComplete(ads) {
    if(ads.length > 0) {
        // we have ads
    }
}

You can find an example of this working here:

http://static.openvideoads.org/qa/latest/ova.jwplayer.5x/examples/pages/javascript/example1.01.00.ht...

I think though, if you have trouble getting your code to work via the "jwplayer(container).playlistItem(id)" approach, I'd take a different approach to the design. Here's what I'd do:

1. Use the OVA schedule() API to load a new clip and ad schedule into OVA with each click on the playlist

2. So on the first item in your Javascript playlist, trigger an OVA schedule call passing in the clip to play and an OVA configuration that has a pre-roll setup

3. On all other playlist items, do an OVA schedule call passing in the clip to load and an OVA configuration with an empty schedule

You can find an example of this "loading each clip and OVA configuration" approach here:

http://static.openvideoads.org/qa/latest/ova.jwplayer.5x/examples/pages/javascript/example2.00.00.ht...

It's a bit cleaner I think because you don't end up loading up a full playlist into the player at the start of the process, and OVA doesn't do anything until a clip is clicked to load.

You can find more examples of this new OVA Javascript interface here:

http://static.openvideoads.org/qa/latest/ova.jwplayer.5x/examples/pages/javascript/example2.00.00.ht...

I should also add, that OVA clips have a property set on them called "ova.hidden" - so if you get a playlist item, and it has "ova.hidden" set on it, you'll know it's an OVA ad - that may also help you navigate the playlist...

Hope this helps...

Paul

Reply

Paul, thank you very much for your help.

With onAdSchedulingComplete function I fixed my problem.
I'm starting to develop a new version of my video widget, and in this new version I will certainly follow the approach you sugested.

Thank you,
Pedro

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