I have just started working with Drupal and the video.module but I am unable to keep the videos from playing continuously over and over again. I have tried adjusting the flowPlayer.js file but either I made an error or it will not suit my needs. How can I keep user/admin submitted videos from looping?

I am looking to create a video upload site and so I would need the site designed in a manner so that end users did not have to add any parameters when uploading their videos.

Any help on this issue would be greatly appreciated.

Comments

glendac’s picture

If your video is embedded inline, set the loop attribute of the embed tag to false. Otherwise, you should be able to specify in a for or while loop how many times you want the video to play.

overlord6’s picture

Thanks for the reply....
I've only been working with Drupal for a few days but I have been able to get it to do everything else I need it to with the exception of this issue.

Could you elaborate on setting the attribute of the loop tag?
Is this something that I can modify so that it pertains to ALL videos on the site?
Since the site will be a user upload/video shaing site most users will simply want to upload their videos an be done with it. I expect most will not be very familiar with Drupal or HTML code/paramaters so I need to make sure that all videos uploaded to the site only play once without being restarted.

Thanks!

glendac’s picture

I don't think this could be a site-wide variable that you could set for all videos uploaded but when your users upload their videos, there's a field in the submission form (HTML object parameters) where they can enter loop as a parameter of the object they are uploading. So they put in <PARAM Name="loop" Value="true" > inside their OBJECT tag set. This could be a pain for many users.

I've also just used Drupal for a little over a month so I haven't fully used the video module. I will try this in the next few days and will report back how it goes.

glendac’s picture

Ok, I tried submitting a video using one of the three methods of submission: pasting code into the body field of video submission form. You can see in the code below (courtesy of Video Code Zone) that autostart is set to 1 but loop is set to false. See how it plays out at my site: http://cms.softtester.org/drupal/node (the video put the right sidebar out of whack). I'll still have to check out uploading a video file and adding HTML object parameters.

<style>.hov:hover{background-color:yellow}</style><div id='Title' style='font:bold 13px verdana;width:300px'>Music Video:<a class='hov' style='display:block;width:300px;border:solid 2px black;padding:5px' href="http://videzon.com/videos/g/gnarls_barkley/crazy.html" target='_blank'>CRAZY (by Gnarls Barkley)<p><embed name='RAOCXplayer' src='http://videzon.com/videos/g/gnarls_barkley/crazy_103950.asx' type='application/x-mplayer2' width='290' height='280' autostart='1' ShowControls='1' ShowStatusBar='0' loop='false' EnableContextMenu='0' DisplaySize='0' pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/'></embed></a><p style="margin:3px 0px"><a href='http://videzon.com/' class=ll target=_blank>Music Video Code provided by Video Code Zone</a></p></div>

glendac’s picture

It should be <PARAM Name="loop" Value="false" >.

overlord6’s picture

Thanks for the reply....
I forgot to mention that this applies to videos that would be uploaded using Drupal as compared to when users would be inserting code to make videos available for viewing.

There is an option for users to place object parameters when uploading videos but....
1. I've been unable to get it to work (by simply placing the code)
2. Even if I was able to get it to work I somehow don't see most web surfers bothering to insert the code when they upload videos.

There is a JavaScript file that comes with FlowPlayer, which the the player used by default to handle .FLV videos and I tried to modifiy that to see if it would stop the problem but I didn't have much luck with it.

If anyone out there has any ideas/suggestions on how to keep these videos from continuously playing I would love to hear it.

glendac’s picture

I have downloaded FlowPlayer and looked at the flowPlayer.js file. There's a line there which shows that loop is set to "true" by default.

/*
	 * 'loop' defines whether the playback should loop to the first clip after
	 * all clips in the playlist have been shown. It is used as the
	 * default state of the toggle button that controls looping. (optional,
	 * defaults to true)
	 */
	loop: true,

Try changing 'true' to 'false' and let us know what happens.

overlord6’s picture

I have been trying this over the last couple of days and thus far no luck. I'm not that familiar with JavaScript but the changes are pretty straightforward and thus far no luck.
I'm not 100% sure if the JavaScript file would work within the Drupal enviorment when videos are uploaded as opposed to embedded. I've been trying to figure that out but no luck. It seems weird that no one has run into this issue before.

glendac’s picture

You can say more about the videos that you say keep playing over and over again. Types - flv, swf, wmv, etc.? Mode of inserting into a video node in Drupal - video file path, upload video file, or pasting code?. Better still, give us a link to your site showing such videos.

You are looking for a global answer but the issue is per video uploaded. Look at the parameters used behind the problem videos you have. The loop attribute is optional for the OBJECT and EMBED tags and the local settings per video will always override whatever global settings you will set.

overlord6’s picture

The videos are .FLV format and they are being uploaded into Drupal. You can check things out on our test site located at: http://www.cybernetdigital.com/drupal
There are 2 videos on the site now but this issue has occured with every .FLV video we used during testing. I think the .FLV file format is really the way to go and so all of the content we will be submitting to the site will be in .FLV but we will allow end users to upload files in other formats but will suggest the use .FLV

Do you know if by default Drupal loops videos uploaded into the CMS?

Thanks for the help.

fax8’s picture

If you are using video module + flv videos just change this line on video.module file

<param name="FlashVars" value="baseURL='. $base_url .'&videoFile='. $file .'&autoPlay=true&bufferLength=5" />' . "\n"

to

<param name="FlashVars" value="baseURL='. $base_url .'&videoFile='. $file .'&autoPlay=true&loop=false&bufferLength=5" />' . "\n"

Hope this helps.

Fabio Varesano

------------
www.varesano.net - Fabio Varesano Personal Homepage

overlord6’s picture

Thank you very much! That solved the problem and I am sure that will save myself as well as plenty of other users of the module a lot of excess bandwidth use.

Thanks again!

Jboo’s picture

For some reason this doesn't work for me. I have made the change to video.module to:

<param name="FlashVars" value="baseURL='. $base_url .'&videoFile='. $file 

.'&autoPlay=true&loop=false&bufferLength=5" />' . "\n"

However my video's (i've only tried swf) still loop. I can fix the problem if I edit the video parameters each time I add a video node but this is a pain.

Any other suggestions?

Thanks.

My new EasySnoozing, Nursing and BusinessEgghead websites on D7!

fax8’s picture

the above code will work for .flv videos.
If you are using .swf videos it will not work.

If you already know what parameter you need to add you
need to harcode it into function theme_video_play_swf
just after ". _video_get_parameters($node) ."

Hope this helps.

Fabio

------------
www.varesano.net - Fabio Varesano Personal Homepage

Allinfo’s picture

This isn't Drupal-specific, but I couldn't get the flv player to recognize either the flowplayer.js setting nor the PARAM tag.

I had to add "loop: false" to the "flashvars" parameter as below, after the name of the video file.

<param name="flashvars" value="config={ videoFile: 'myvideofile.flv', loop: false }" />

This is the only thing that worked for me. I'm using Flowplayer 1.12. It behaved the same in both Apache 2 on Linux and IIS on Windows Server 2003. I'm using Flash Player 9 on Firefox 2.0 and Internet Explorer 6.

Hope this will help someone.

EDIT:

Oops -- I hadn't been telling it to use my config file, like:

<param name="flashvars" value="config={configFileName: 'flowPlayer.js'}" />

as per http://flowplayer.sourceforge.net/howto.html#config

Just to clarify,

<PARAM Name="loop" Value="false" >

doesn't work for me.

Cheers.

daniel-san’s picture

I am so glad I found this thread. I have been battling this for some time. I am experienced in using Flash video and using it on HTML static sites in the past, but using it in the video module was a bit frustrating that the parameters wouldn't work. It just wouldn't work for me.
I prefer the video module to the other flash options because the others all require ffmpeg and want to create thumbnails. I do my own conversion through Hey!Watch (www.heywatch.com) and create my own thumbnails. So I prefer to have a little control rather than upload for conversion.

Now that understand how to adjust the video.module, my videos will no longer loop... a HUGE frustration previously.

Thanks for the info.

Dan