This project is read-only.

Cancel autoplay

Aug 31, 2010 at 2:13 PM

I installed this webpart and successfully activated it in sharepoint. But after placing a 'sharepoint video player'-webpart on a page, the video automatically starts playing.

Is there any way to not have the video start playing automaticly?

Sep 1, 2010 at 2:32 AM

I have also been searching for the method to prevent videos playing by default.

We have 4 players on one page all kicking off at the same time...

Sep 6, 2010 at 8:09 AM
Edited Sep 6, 2010 at 12:11 PM

Okay, I've got a javascript (thanks to the help of a colleague) that pauses all flowplayer video's on a page: (I thought that I could post it, for when anyone else needed it)

getPauseOnPlay = function(flPlayer){
     return function(){
	if(flPlayer.getState() == 3){	
		flPlayer.pause();
	}else{
		window.setTimeout(getPauseOnPlay(flPlayer), 50);
	}
    }
}
				
flowplayer("*").each(function() {
	// 'this' refers to the loop's current Player instance
	var flPlayer = this;
	window.setTimeout(getPauseOnPlay(flPlayer), 50);
});

This script should be inserted on the end of the page (or page lay-out). When the page loads, 
the script will run and pause the video if it's state is set to 'playing'. 
If it's not playing it will check the state again after a small timeout. If the user wants to play the video, (s)he can simple use the video controls.

A build-in 'autoplay' option would still be nice though...
Oct 15, 2010 at 5:44 AM

Can someone please give me some insight as to how to prevent auto play. I opened the default.aspx page that the webpart is one, then added the script inside a <Script type='text/javascript'></script> tag but it doesn't work.

Any help will be very much apprieciated.


Thanks,

 

Oct 20, 2010 at 2:48 PM

I hope someone can give me a hand. I added the javascript above the a test.aspx page (at the end) and I get an error.

An error occurred during the processing of /SI SharePoint Content/testing video.aspx. Only Content controls are allowed directly in a content page that contains Content controls.

 

I have just copied the script, put inside <script type='text/javascript'></script> and opened the page.

 

Any ideas? Please let me know if you have any insight

Oct 27, 2010 at 7:24 PM

I added it to a Content Editor Web Part on the same page you have the video and works.

Thanks for the easy solution.

Oct 28, 2010 at 7:47 AM
Edited Oct 28, 2010 at 7:52 AM
bbcac wrote:

I have just copied the script, put inside <script type='text/javascript'></script> and opened the page.

 

Any ideas? Please let me know if you have any insight

 Did you place the script before the (last) </asp:Content> tag has been closed? If not try placing it before the </asp:content> tag.

You can also try what amirsahebjam said and add it to to the Content Editor Web Part.