0

I am using Channel Videos from DevDemon to pop up videos in a Fancybox modal. The videos are hosted on Vimeo. Does anyone know how to make the videos autoplay?

I am looping through the relational entries like so:

<ul class="portfolio recent-work clearfix">
    {exp:channel:entries 
        disable="category_fields|member_data|pagination" 
        category="1" 
        channel="program_module" 
        status="open" 
        show_future_entries="no" 
        show_expired="no" 
    }
        {video_groups_to_include}
            {exp:channel_videos:videos 
                status="open" 
                entry_id="{video_groups_to_include:entry_id}" 
            }
                <li data-id='id-{video:id}' class='{video_groups_to_include:categories}{category_url_title}{/video_groups_to_include:categories}'>
                    <a href="{site_url}_video/{video:id}" data-html="{site_url}_video/{video:id}" class="fancybox-lesson player" data-rel="fancybox-lesson" title="{video:title}">
                        <em class="overflow-hidden"><img src="{video:img_url_hd}" alt="{video:title}" /></em>
                        <span>
                            <strong>{video:title}</strong>
                            <i>{video:description}</i>
                        </span>
                    </a>
                </li>
            {/exp:channel_videos:videos}
        {/video_groups_to_include}
    {/exp:channel:entries}
</ul>

Then the video embed is done here:

{if logged_out}
    {redirect="{site_url}"}
{/if}
{if logged_in}
    {exp:channel_videos:videos 
        status="open" 
        video_id="{segment_2}" 
        embed_width="630" 
        embed_height="354"
    }
        {video:embed_code_hd}
    {/exp:channel_videos:videos}
{/if}

The js to kick off the modal is here:

jQuery(".fancybox-lesson").fancybox({
    'padding'       : 0,
    'autoScale'     : false,
    'transitionIn'  : 'none',
    'transitionOut' : 'none',
    'title'         : this.title,
    'width'         : 630,
    'height'        : 354,
    'href'          : this.href,
    'type'          : 'ajax'
});

I don't care at which stage I accomplish this as long as it occurs once the video is loaded.

1

Try adding '?autoplay=1' to the end of your video link URL after the video id.

2
  • I don't have that option. I am using Channel Videos to manage videos and thus the {video:embed_code_hd} tag.
    – W3bGuy
    Apr 25 '14 at 2:27
  • Perhaps you can edit the 'js to kick off the modal' then? Does something like 'href' : this.href + '?autoplay=1' work?
    – AllInOne
    May 27 '14 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.