This is a message.

Making content plug-in hide while video plays Created Jan 27, 2011

This thread is solved

Views: 1786     Replies: 6     Last reply Jan 9, 2012  
You must login first before you can use this feature

steveap1

Posts: 3

Registered:
Sep 10, 2009

Making content plug-in hide while video plays

Posted: Jan 27, 2011

I would like to use the 'flowplayer.content-3.2.0.swf' to show content when the player is paused or stopped, but hide while the video plays. If the content plug cannot do this, is there another solution? Basically I want an ad to show when the player loads, but hide while the video plays, then appear again when the video finishes. I have seen this done, but I cannot seem to make it happen .

steveap1

Posts: 3

Registered:
Sep 10, 2009

» Making content plug-in hide while video plays

Posted: Jan 27, 2011

Reply to: Making content plug-in hide while video plays, from steveap1
I failed to include code in the previous post. Perhaps I was not clear.

I set up a test page here:

http://sportersmusic.com/FlowplayerTest-10.html

The content overlay with the link works, but I want it to show up only when the video is paused, and/or at specific intervals.

I know there are 'onPause' event type functions, but I need the plugin to be controlled by these event functions. That's what I cannot figure out how to do.


<script language="JavaScript">

$f("player", "/flowplayer/flowplayer-3.2.5.swf",  {
		clip: {
	baseUrl: 'http://sportersmusic.com/clips/',
		// a clip event is defined inside clip object
		},
		plugins:  {
			// "myContent" is the name of our plugin
	myContent: {

		// location of the plugin
		url: 'flowplayer/flowplayer.content/flowplayer.content-3.2.0.swf',

		// display properties
		top: 20,
		width: 300,

		// styling properties
		borderRadius: 10,

		// linked stylesheet

		// "inline" styling (overrides external stylesheet rules),
		style: {
			'.title': {
				fontSize: 24,
				fontFamily: 'verdana,arial,helvetica',
			color: '#f0f0f0',
			textAlign: 'center',
			}
		},
		html: '<a href="http://sportersmusic.com/" class="title">Sporters Music</a>',

		// clicking on the plugin hides it (but you can do anything)
	
		onClick: function() {
			this.hide()
		},
		closeButton: true,
	opacity: 1.0
	}
	},
	// here is our playlist with two clips
	playlist: [
		// this first PNG clip works as a splash image
		{
			url: 'testpilot.png', 
		},
		// second clip is a video. when autoPlay is set to false the splash screen will be shown
		{
			url: '20051210-w50s.flv', 
			autoPlay: false, 
			autoBuffering: true 
		}
	],
	
});
</script>

andrew_v

Posts: 6

Registered:
Nov 11, 2010

» Making content plug-in hide while video plays

Posted: Feb 5, 2011

Reply to: Making content plug-in hide while video plays, from steveap1
The JavaScript way is calling
$f().getPlugin('myContent').hide();
on onResume event and
$f().getPlugin('myContent').show();
on onStop.

I'm not sure but there is somewhere, in demos, sample of event handling.

steveap1

Posts: 3

Registered:
Sep 10, 2009

» » Making content plug-in hide while video plays

Posted: Feb 8, 2011

Reply to: » Making content plug-in hide while video plays, from andrew_v
OK, that helps. I dug around and came up with this:

http://sportersmusic.com/FlowplayerTest-10.html

Using:

   onCuepoint: [[5000], function(clip,point) {   
                           // var myContent = this.getPlugin("myContent");  
                           this.getPlugin("myContent").show(); 
                           // myContent.show();   

This is workable and very close, I just need to add more cuepoints in the clip. When I try to add another cuepoint to hide the content plug using

this.getPlugin("myContent").hide();

I get errors. Can you put several cuepoints so as to make the content come and go?