Embedded Video How To - Start Youtube mid-video

Here is a simple trick that I learned while creating a small, fun video site on a whim. The main problem is that we wanted to start some Youtube videos at a specific interval in the video, say 30 seconds in. We were already use the Embedded Media Field set of modules of CCK (http://drupal.org/project/emfield, with the video/youtube addon modules), but mid-video starts aren't supported (yet as I will submit a patch shortly to add this functionality to the options array).

I will write more about the full site build at a later time, but here is what I did to tackle this issue. I am assuming that you are familiar with CCK, EM Field modules and a bit of knowledge to theme a node template.

Here is what I did:

1) Create the embedded video field for youtube ('field_song_video' in my implementation).
2) Create am integer field to hold the number of seconds into the video to start ('field_song_start' in my implementation).
3) Remove from Display on the node both of these fields.
4) Updated my node-songs.tpl.php (replace with your appropriate node template file).
5) Where I wanted my video to be embedded I placed the following code:

<?php print theme('emvideo_youtube_flash', $node->field_song_video[0]['value'] .'&start='.$node->field_song_start[0]['value'], 450, 350, 0); ?>

The main part to notice is the '&start=...' part. The theming function for the youtube player will add the start variable to the Youtube request URL which will start the video at a later place than the beginning. The other arguments are the size of the player (450px by 350px) and the auto-start flag.

NOTE: The API has changed a bit since my site implementation so the new code would look like this (replace 'emvideo_youtube_flash' with 'video_cck_youtube_flash').

<?php print theme('video_cck_youtube_flash', $node->field_song_video[0]['value'] .'&start='.$node->field_song_start[0]['value'], 450, 350, 0); ?>

Thanks for taking the time to

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. It is extremely helpful for me.
Digital Printing
Thank you for sharing.

Latinos instigate violence

Latinos instigate violence and hatred for recreation. They do it purposely to exploit their instinctual victim role and then exploit the American system to sue for damages. They have elevated staged car accidents to a science, and now staged racial violence is their scam du jour.

lawyers

Thanks, its a very good

Thanks, its a very good information of sharing and making people know about the activites that are being carried out.
web design nyc

Pretty good post. I just

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts.
Caviarthanks for sharing

Nice advice i was searching

Nice advice i was searching for tips like this and its my lucky day that i have found not only yours but 2-3 more useful tips keep up the good work . Love your work.HTML Menu Buttons

I like when people are trying

I like when people are trying to challenge me, and I appreciate that you maintain a fairly active dialogue with your readers. Couldn't agree any more. Your advice is great. Hot Ukraine Girls

For the next week, shut off

For the next week, shut off the TV, go to no public places, stock up on some good books (and wine!), maybe even do a spot of fornication if the opportunity presents...

army surplus

Its something new for me to

Its something new for me to learn from this post. I sometimes do use youtube but this is what i can apply now on youyube.

There are thousands of

There are thousands of interesting video clips available at the YouTube video sharing site. Of course you can’t deny there are many pretty long and boring clips amongst the interesting ones.

home theater seating

We use a multi-site setup,

We use a multi-site setup, with some distinct tables (mostly for look and feel changes across the sub-domains like menus, blocks, views and panels). The multi-sites are differentiated along taxonomy vocabulary lines.mcdst certification
Sub-divided permissions were created using distinct permission tables, with shared roles and users, matched with the Taxonomy Access control module. This setup enables sub-domain specific editors and administrators who oversee content and submissions in one or more taxonomy categories.

"It's one of the very few

"It's one of the very few songs I wrote for a girl. I just moved in with my girlfriend in New York. We had a neighbour: an old woman who was always dressed in purple head to toe. She was clearly bonkers. So whenever my girlfriend and I had an argument and she would start screaming at me, I would say: you might as well start wearing purple now".[1] In another interview, he stated that the song was written in 1995

Really the blogging is

Really the blogging is spreading its wings rapidly. Your write up is fine example of it. Outsourced scanning