Skip Navigation

[Resolved] Can't make embedded video autoplay

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.

This thread is resolved. Here is a description of the problem and solution.

Problem:
I am trying to make the embedded media field to autoplay. However it won't let me.

<?php $renderfieldmedia = types_render_field('film', array('raw'=>'true'))?>
     <?php if(!empty($renderfieldmedia)){?>
          <div id="videoholder">
               <dd><?php echo(types_render_field('film', array("output" => "html", "autoplay" => "on"))); ?></dd>
          </div>

Solution:
you are using a custom embedded media field, I tested with a custom video field, sorry for the misunderstand.

According to our document:
https://toolset.com/documentation/customizing-sites-using-php/functions/#embedded-media
There isn't "autoplay" option in custom embedded media field, and it is wordpress do not support "autoplay" for embed media.

I search in google, and find this thread:
http://wordpress.stackexchange.com/questions/5362/wp-oembed-not-passing-through-the-autoplay-1-variable
Relevant Documentation:

This support ticket is created 7 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Author
Posts
#403098

I am trying to make the embedded media field to autoplay. However it won't let me.

<?php $renderfieldmedia = types_render_field('film', array('raw'=>'true'))?>
     <?php if(!empty($renderfieldmedia)){?>
          <div id="videoholder">
    	       <dd><?php echo(types_render_field('film', array("output" => "html", "autoplay" => "on"))); ?></dd>
    	  </div>

Any ideas?

#403236

Dear Ole,

I can not duplicate same problem in my localhost, I tested your codes and add a line at the bottom:

	 <?php }?>

It works fine, and the video does auto-play.
I suggest you check these:
1) make sure you are using the latest version of WP-TYPES plugins
2) deactivate other plugins and switch to wordpress default theme, and test again
3) Also check if there is any JS error occur in your webpage.

#403238

Thank you.

1. Checked if used the latest Toolset Types plugin, and that is correct.
2. Deactivated almost all plugins, but still nothing.
3. Removed almost all JS, and did not solve anything. Can't find any errors on the page.

Maybe you can see something wrong if I give you the url? hidden link

Best regards

#403268

Since you are using custom theme + other plugins, and I can not duplicate same problem in my localhost, so as I suggest you above:
deactivate other plugins and switch to wordpress default theme, and test again
You can simply add below codes into theme file "single.php":

<?php $renderfieldmedia = types_render_field('film', array('raw'=>'true'))?>
     <?php if(!empty($renderfieldmedia)){?>
          <div id="videoholder">
               <dd><?php echo(types_render_field('film', array("output" => "html", "autoplay" => "on"))); ?></dd>
          </div>
	 <?php }?>

This works fine in my localhost (fresh wordpress installation + 2016 wordpress default theme).
If the problem still exists, please duplicate same problem in a test site, and fill below private detail box with login details and ftp access, also point out where I can edit your PHP codes. I need a live website to test and debug. thanks

#403574

Thanks for the details, you are using a custom embedded media field, I tested with a custom video field, sorry for the misunderstand.

According to our document:
https://toolset.com/documentation/customizing-sites-using-php/functions/#embedded-media
There isn't "autoplay" option in custom embedded media field, and it is wordpress do not support "autoplay" for embed media.

I search in google, and find this thread:
http://wordpress.stackexchange.com/questions/5362/wp-oembed-not-passing-through-the-autoplay-1-variable

Hope it help

#403586

Oh, I see. One last question: Is it possible to add videos from YouTube using custom video field then?

#403588

Problem solved with the links you provided. Thanks for helping me out. Have a nice day

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.