• Before posting a question, please check our Frequently Asked Questions page as well as previous threads here. Odds are you aren't the first to ask, and you may find the answer without having to post!

Is Video Autoplay Disabled?

OverconfidentMagi

Laugh Like You've Won Always
Roleplay Availability
Roleplay Type(s)
So I was playing around with HTML and embedding a youtube video to play some background music whenever the page loads up, and everything works fine in the editor. The problem is that as soon as I hit submit it stops working. Going back in and looking at the source code, everything is the same except the autoplay=1 piece has been removed. Is this intended? If I can't do what I'm trying to do that's fine, I just don't want to be left thinking maybe if I try this it'll work.


The code before submit:


<p>
<iframe height="345" src="https://www.youtube.com/embed/[VIDEO ID]?rel=0&autoplay=1&loop=1&playlist=[VIDEO ID]" style="display:none;" width="420"></iframe>
</p>


And the code after submit:


<p>
<iframe height="345" src="https://www.youtube.com/embed/[VIDEO ID]?rel=0&loop=1&playlist=[VIDEO ID]" style="display:none;" width="420"></iframe>
</p>




I added the code to show what's happening. If anyone wants to try it just paste the first example into your post (add any youtube video ID) and it should play automatically when you switch out of source. 
 
Last edited by a moderator:
I have two theories.


My first theory is that this is the site protecting itself from something which could be malicious.  Since this coding essentially forces other people to listen to the song, it's preventing you from using it, since it also targets something which is outside of the posts text.  I hope this makes sense. :P   This is why it also works when you view in the editor before saving because the coding isn't really being implemented to the site.  Of course, this can be debunked by your own signature.


My second theory is that this piece acts more like a piece of Java than HTML since it affects the function of the post rather than the aesthetic.  Right now, I think the site is only allowing users to use HTML and CSS.
 
My signature is simply a background image with a fixed location, nothing outside of the post is affected really, despite what it might look like. It's fun to add to random posts as well.


Your first theory is probably right. I wasn't thinking of how easy it would be to put in an... unpleasant video id and spam every page with having to hear it play nonstop.


I'll just shelve that line of HTML experiments for now then. It's for the best.
 
My signature is simply a background image with a fixed location, nothing outside of the post is affected really, despite what it might look like. It's fun to add to random posts as well.


Your first theory is probably right. I wasn't thinking of how easy it would be to put in an... unpleasant video id and spam every page with having to hear it play nonstop.


I'll just shelve that line of HTML experiments for now then. It's for the best.



That is literally the trippiest thing I've seen on this site so far. Even though it doesn't have much use, that's really cool, lol. Nice image choice, too!


@OverconfidentMagi
 
So I was playing around with HTML and embedding a youtube video to play some background music whenever the page loads up, and everything works fine in the editor. The problem is that as soon as I hit submit it stops working. Going back in and looking at the source code, everything is the same except the autoplay=1 piece has been removed. Is this intended? If I can't do what I'm trying to do that's fine, I just don't want to be left thinking maybe if I try this it'll work.


The code before submit:



<p>
<iframe height="345" src="https://www.youtube.com/embed/[VIDEO ID]?rel=0&autoplay=1&loop=1&playlist=[VIDEO ID]" style="display:none;" width="420"></iframe>
</p>


And the code after submit:



<p>
<iframe height="345" src="https://www.youtube.com/embed/[VIDEO ID]?rel=0&loop=1&playlist=[VIDEO ID]" style="display:none;" width="420"></iframe>
</p>




I added the code to show what's happening. If anyone wants to try it just paste the first example into your post (add any youtube video ID) and it should play automatically when you switch out of source. 
Code:
<iframe width="640" height="360" src="[YouTube Video URL]?rel=0&autoplay=1" frameborder="0" allowfullscreen></iframe>
 
Code:
<iframe width="420" height="315" src="http://www.youtube.com/embed/
oHg5SJYRHA0?autoplay=1&cc_load_policy=1" frameborder="0"
allowfullscreen></iframe>

Code:
<iframe width="420" height="315" src="http://www.youtube.com/embed/
oHg5SJYRHA0?autoplay=1&cc_load_policy=1" frameborder="0"
allowfullscreen></iframe>
 
Last edited by a moderator:
Actually, you will have to use the "?" instead of "&" for your first parameter only. If you use more than one parameter, you will then have to add "&" to the chain.


For instance, if you want to add autoplay and closed captioning, you will have to add this portion to your embedded video URL: ?autoplay=1&cc_load_policy=1.


It would look like this:

Code:
<iframe width="420" height="315" src="http://www.youtube.com/embed/
oHg5SJYRHA0?autoplay=1&cc_load_policy=1" frameborder="0"
allowfullscreen></iframe>



shareimprove this answer




 
 
Last edited by a moderator:
Is that Yin from Darker than Black or am I wrong?? *casually jumps into conversation with a side subject*

It is. I was playing around with html to make a cs using her as the base. Decided I liked the picture.


@TurquoiseTurtle


Since everything you posted isn't working, I'm going to assume it ran into the same problem as when I did it with the code changing when you hit submit.
 

Users who are viewing this thread

Back
Top