You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

Clip duration for advertisements Created Jan 16, 2009

This thread is solved

Views: 3751     Replies: 9     Last reply Jun 18, 2009  
You must login first before you can use this feature

Arun

Posts: 22

Registered:
Jan 10, 2009

Clip duration for advertisements

Posted: Jan 16, 2009

Hey Guys,

I am planning to show a HTML text in the player advising the user of time remaining" Example: "Advertisement: Your video will begin in N seconds."

I am planning to do the arithmetic: "Advertisement: Your video will begin in (clip.fullDuration - clip.duration) seconds."

Has anyone done this before? Please advise. (I have to send this to my development team and i dont have a way of testing this myself. Any help is greatly appreciated.)

Thanks!
Arun.

Arun

Posts: 22

Registered:
Jan 10, 2009

Help - Clip Duration

Posted: Jan 17, 2009

Reply to: Clip duration for advertisements, from raghavarun
Hi api, tipirai or any other developers,
can you please advise?

Thanks!
Arun.

Anssi
Flowplayer Flash & video streaming developer

Posts: 1194

Registered:
Jul 24, 2007

» Clip duration for advertisements

Posted: Jan 18, 2009

Reply to: Clip duration for advertisements, from raghavarun
It has been done in this site:http://www.fightnightlive.co.uk/

The site was developed by LiamGooding who is frequent contributor in these forums.

Liam Gooding
Custom swf skins, custom swf plugins, custom JS plugins, video CMS - http://goodingsmedia.com

Posts: 352

Registered:
Dec 16, 2008

» Clip duration for advertisements

Posted: Jan 20, 2009

Reply to: Clip duration for advertisements, from raghavarun
Assuming you have already inserted the content plugin etc.


onStart: function(clip) {  
    // now present user with time remaining time of ad
    // place inside your 'clip' or playlist item
    this.getPlugin("content").animate({opacity:1.0}, 1200); // this line just fades in the content plugin
    var remaining = clip.duration; 
    var myPlayer = this;   
    var timer = setInterval(function() {   
        myPlayer.getPlugin("content").setHtml("<p align="center"> Advertisement. Your video will start in " + Math.round(clip.duration - myPlayer.getTime()) +"</p>");  
        if (remaining < 1) clearInterval(timer);   
            }, 1000);  
}

Liam Gooding
Custom swf skins, custom swf plugins, custom JS plugins, video CMS - http://goodingsmedia.com

Posts: 352

Registered:
Dec 16, 2008

» » Clip duration for advertisements

Posted: Jan 20, 2009

Reply to: » Clip duration for advertisements, from LiamGooding
And here's something even better......

Flowplayer forum example

HTML setup for the player

<!-- include latest Flowplayer javascript file -->
<script language="javascript" src="path/to/flowplayer-3.2.6.js"></script>

<!-- player container with optional splash image -->
<a href="path/to/video_file" id="playerContainer">
	<img src="path/to/splash_image" />
</a>


JavaScript coding

Following script will install Flowplayer into our player container


<script language="javascript">
// our custom configuration is given in third argument
flowplayer("playerContainer", "path/tohttp://releases.flowplayer.org/swf/flowplayer-3.2.7.swf",{
plugins: {
    content: {
        url: 'http://flowplayer.org/swf/flowplayer.content-3.0.1.swf', 
        bottom: 40, 
        left:83,
        width: 260,   
        height:30,
        
        // styling
        backgroundColor:'#000000',
        backgroundGradient:'low',
        borderRadius:'0',
        borderColor:'#222222',
        align:'center',
        opacity:0
    }
},

clip: {
    url: 'http://blip.tv/file/get/KimAronson-TwentySeconds1318.flv',
    
    onStart: function(clip) {  
        // now present user with time remaining time of ad
        // place inside your 'clip' or playlist item
        this.getPlugin("content").animate({opacity:1.0}, 1200);
        var remaining = clip.duration; 
        var myPlayer = this;   
        var timer = setInterval(function() {   
            myPlayer.getPlugin("content").setHtml("Advertisement. Your video will start in " + Math.round(clip.duration - myPlayer.getTime()));  
            if (remaining < 1) clearInterval(timer);   
                }, 1000);  
    }
}
});
</script>


I suppose I could throw this up as a demo for the demo's section?

Arun

Posts: 22

Registered:
Jan 10, 2009

» » » Clip duration for advertisements

Posted: Jan 20, 2009

Reply to: » » Clip duration for advertisements, from LiamGooding
LiamGooding,

This is fantastic. Please add this to our demo section.

Many Many Thanks for your help!
Arun.

Tero
Author of jQuery Tools and this website + JavaScript developer of Flowplayer.

Posts: 1867

Registered:
Nov 16, 2007

» » » Clip duration for advertisements

Posted: Jan 20, 2009

Reply to: » » Clip duration for advertisements, from LiamGooding
great to see posts like this. nice.

nick800

Posts: 11

Registered:
Jun 16, 2009

» » » Clip duration for advertisements

Posted: Jun 18, 2009

Reply to: » » Clip duration for advertisements, from LiamGooding
This is kind of an old post, but I'm trying to implement something like this info an instream playlist, can anyone help me tweak it to work?

I'm a little confused by the clip in onStart. What is the proper sintax for this when it's inside of a playlist. Also the onStart event doesn't seem to be firing for me. ( Ignore the actual player, just using the < flowplayer > to show the code.

Flowplayer forum example

HTML setup for the player

<!-- include latest Flowplayer javascript file -->
<script language="javascript" src="path/to/flowplayer-3.2.6.js"></script>

<!-- player container with optional splash image -->
<a href="path/to/video_file" id="playerContainer">
	<img src="path/to/splash_image" />
</a>


JavaScript coding

Following script will install Flowplayer into our player container


<script language="javascript">
// our custom configuration is given in third argument
flowplayer("playerContainer", "path/tohttp://releases.flowplayer.org/swf/flowplayer-3.2.7.swf",{
<script>
				flowplayer("player", "./includes/flowplayer-3.1.1.swf",{ 
					plugins: { 
						content: { 
							url: './includes/flowplayer.content-3.1.0.swf',  
							bottom: 5,  
							left:80, 
							width: 300,    
							height:30, 
							 
							// styling 
							backgroundColor:'#000000', 
							backgroundGradient:'low', 
							borderRadius:'0', 
							borderColor:'#222222', 
							align:'center', 
							opacity:0 
						} 
					}, 
					playlist: [
						{ url:"[INITIAL IMAGE]" , autoPlay: true,
							scaling: "fit" } ,
						{ 
							
							url: "[MAIN VIDEO]",
							scaling: "fit", 
							autoPlay: false,

							playlist:[
									
								{ 
									url:"[PREROLL]" , autoPlay: true, position:0,
									 onStart: function(clip) {   
										// now present user with time remaining time of ad 
										// place inside your 'clip' or playlist item 
										this.getPlugin("content").animate({opacity:1.0}, 1200); 
										var remaining = clip.duration;  
										var myPlayer = this;    
										var timer = setInterval(function() {    
											myPlayer.getPlugin("content").setHtml("A word from our sponsors... " + Math.round(clip.duration - myPlayer.getTime()));   
											if (remaining < 1) clearInterval(timer);    
												}, 1000);   
									} 	
								
								},
								{ url:"[POSTROLL]" , autoPlay: true, position:-1 }
							]
						}
					]
					
				}); 
			</script>
});
</script>


nick800

Posts: 11

Registered:
Jun 16, 2009

» » » » Clip duration for advertisements

Posted: Jun 18, 2009

Reply to: » » » Clip duration for advertisements, from nick800
it appears onFinish events fire but not onStart

nick800

Posts: 11

Registered:
Jun 16, 2009

» » » » » Clip duration for advertisements

Posted: Jun 18, 2009

Reply to: » » » » Clip duration for advertisements, from nick800
Nevermind, onBegin works, must be a new syntax

argh nevermind again, it only fires on the main playlist clips and not the nested playlist inside the main movie.