• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.1 Hey

#1
I've googled and search the forums countless numbers of times..
How do I enabled autoplay for a youtube video in a thread?

I want a youtube video to be able to autoplay as they read my thread, I've seen others do this.
Any suggestions?
 
#3
I did :/
This is the video I want:
Code:
http://www.youtube.com/watch?v=aeYTBvanFmE&feature=player_embedded
I added this to my Media adder:

But it's not doing anything..

 

steel_curtain

Well-known member
#8
The bbcode parser is stripping out everything but the video id upon embed. You'd have to either adjust the embed HTML in BB Code Media Sites in the ACP, or install an add-on like parse HTML to do it manually (as far as I know).
 

Jake Bunce

XenForo moderator
Staff member
#9
Admin CP -> Home -> BB Code Media Sites -> YouTube -> Embed HTML

Add the red code:

Code:
<iframe width="500" height="300" src="http://www.youtube.com/embed/{$id}?wmode=opaque&autoplay=1" frameborder="0" allowfullscreen></iframe>
But this will affect all youtube videos on your forum. More effort is required to make it not affect all videos (as in creating a PHP callback for the media site).
 

Ablac

Active member
#12
How would one go about making the users define if its Auto play or not?

Couldnt you change the BBCode to have a Second ID and use youtube.com/watch?v={$id}\{$id2}
Cause websites dont register \ but you could use that to separate the ID's

I tried it on my site but i suck with BBCode :( and not even sure if my theory is correct :p
 

Brogan

XenForo moderator
Staff member
#13
What do you mean by users?

You can have two different embed codes, one with autoplay, one without; members can choose which one to use when posting a video.
 
#16
How would one go about making the users define if its Auto play or not?

Couldnt you change the BBCode to have a Second ID and use youtube.com/watch?v={$id}\{$id2}
Cause websites dont register \ but you could use that to separate the ID's

I tried it on my site but i suck with BBCode :( and not even sure if my theory is correct :p

Yes, exactly what I'm trying to do..
How do we do this?
 

Ablac

Active member
#17
I just did what Brogan Suggested, create another Youtube BBCode, cept instead of naming it Youtube name it YoutubeAuto (Or something along those lines) and give it the Auto Play Script.

So when you past a youtube video it will default to
Code:
[media=youtube](ID)[/media]
But with the second BBCode names YoutubeAuto you can change it to
Code:
[media=youtubeauto](ID)[/media]
Thats what i did on my forums.
 

RoldanLT

Well-known member
#18
Admin CP -> Home -> BB Code Media Sites -> YouTube -> Embed HTML

Add the red code:

Code:
<iframe width="500" height="300" src="http://www.youtube.com/embed/{$id}?wmode=opaque&autoplay=1" frameborder="0" allowfullscreen></iframe>
But this will affect all youtube videos on your forum. More effort is required to make it not affect all videos (as in creating a PHP callback for the media site).
How about Facebook ?