Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions flowplayer-beta/fv-flowplayer.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ flowplayer(function (api,root) {
api.trigger('finish', [ api] );
});
}

var player_id = root.attr('id');
api.bind("ready", function (e, api) {
//console.log('ad ready to show',root.attr('class'));
Expand All @@ -857,18 +857,19 @@ flowplayer(function (api,root) {
root.find('.fp-player').append( '<div id="'+player_id+'_ad" class="wpfp_custom_ad">'+html+'</div>' );
}
}).bind("finish", function (e, api) {
if( typeof(api.video.index) == "undefined" || api.video.index+1 == api.conf.playlist.length ) {
if( root.find('.wpfp_custom_popup').length > 0) {
if( typeof(api.video.index) == "undefined" || api.video.index+1 == api.conf.playlist.length || api.video.index+2 == api.conf.playlist.length ) {
// just an ordinary popup
if (root.find('.wpfp_custom_popup').length > 0) {
root.find('.wpfp_custom_popup').show();
} else if( typeof(fv_flowplayer_popup) != "undefined" && typeof(fv_flowplayer_popup[player_id]) != "undefined" ) {
root.find('.fp-player').append( '<div id="'+player_id+'_custom_popup" class="wpfp_custom_popup">'+fv_flowplayer_popup[player_id].html+'</div>' );
} else if (typeof(fv_flowplayer_popup) != "undefined" && typeof(fv_flowplayer_popup[player_id]) != "undefined") {
root.find('.fp-player').append('<div id="' + player_id + '_custom_popup" class="wpfp_custom_popup">' + fv_flowplayer_popup[player_id].html + '</div>');
}
}

}).bind("pause", function (e, api) {
// NOTE: this feature is for showing a Pay Per View purchase popup, when the PPV plugin is enabled,
// it does nothing with ads or other popups!
if( typeof(api.video.index) == "undefined" || api.video.index+1 == api.conf.playlist.length ) {
if( typeof(api.video.index) == "undefined" || api.video.index+1 == api.conf.playlist.length || api.video.index+2 == api.conf.playlist.length ) {
if( root.find('.wpfp_custom_popup').length > 0 && root.find('.wpfp_custom_popup > .fv-player-ppv-purchase-btn-wrapper')) {
root.find('.wpfp_custom_popup').show();
} else if( typeof(fv_flowplayer_popup) != "undefined" && typeof(fv_flowplayer_popup[player_id]) != "undefined" && fv_flowplayer_popup[player_id].html.indexOf('fv-player-ppv-purchase-btn-wrapper') > -1 ) {
Expand All @@ -888,6 +889,11 @@ flowplayer(function (api,root) {
next();
} );*/
}

// do not advance to the last AD if there's a popup to be shown
if (api.video.index+2 == api.conf.playlist.length) {
api.conf.advance = false;
}
});
});

Expand Down
18 changes: 12 additions & 6 deletions flowplayer/fv-flowplayer.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ flowplayer( function(api,root) {
}, 100 );
});

api.bind('finish', function() {
api.bind('finish', function() {
if( root.data('fv_redirect') ) {
var url = root.data('fv_redirect');
var windowFVFlowplayerRedirect = window.open(url, '_blank');
Expand Down Expand Up @@ -848,18 +848,19 @@ flowplayer(function (api,root) {
root.find('.fp-player').append( '<div id="'+player_id+'_ad" class="wpfp_custom_ad">'+html+'</div>' );
}
}).bind("finish", function (e, api) {
if( typeof(api.video.index) == "undefined" || api.video.index+1 == api.conf.playlist.length ) {
if( root.find('.wpfp_custom_popup').length > 0) {
if( typeof(api.video.index) == "undefined" || api.video.index+1 == api.conf.playlist.length || api.video.index+2 == api.conf.playlist.length ) {
// just an ordinary popup
if (root.find('.wpfp_custom_popup').length > 0) {
root.find('.wpfp_custom_popup').show();
} else if( typeof(fv_flowplayer_popup) != "undefined" && typeof(fv_flowplayer_popup[player_id]) != "undefined" ) {
root.find('.fp-player').append( '<div id="'+player_id+'_custom_popup" class="wpfp_custom_popup">'+fv_flowplayer_popup[player_id].html+'</div>' );
} else if (typeof(fv_flowplayer_popup) != "undefined" && typeof(fv_flowplayer_popup[player_id]) != "undefined") {
root.find('.fp-player').append('<div id="' + player_id + '_custom_popup" class="wpfp_custom_popup">' + fv_flowplayer_popup[player_id].html + '</div>');
}
}

}).bind("pause", function (e, api) {
// NOTE: this feature is for showing a Pay Per View purchase popup, when the PPV plugin is enabled,
// it does nothing with ads or other popups!
if( typeof(api.video.index) == "undefined" || api.video.index+1 == api.conf.playlist.length ) {
if( typeof(api.video.index) == "undefined" || api.video.index+1 == api.conf.playlist.length || api.video.index+2 == api.conf.playlist.length ) {
if( root.find('.wpfp_custom_popup').length > 0 && root.find('.wpfp_custom_popup > .fv-player-ppv-purchase-btn-wrapper')) {
root.find('.wpfp_custom_popup').show();
} else if( typeof(fv_flowplayer_popup) != "undefined" && typeof(fv_flowplayer_popup[player_id]) != "undefined" && fv_flowplayer_popup[player_id].html.indexOf('fv-player-ppv-purchase-btn-wrapper') > -1 ) {
Expand All @@ -879,6 +880,11 @@ flowplayer(function (api,root) {
next();
} );*/
}

// do not advance to the last AD if there's a popup to be shown
if (api.video.index+2 == api.conf.playlist.length) {
api.conf.advance = false;
}
});
});

Expand Down