AutoPlay with Youtube Videos

Alright so I have been messing around with the autoplay feature and I can confidently say that I got it to work....sometimes. I'm gonna leave my solution here and myabe someone smarter than me can pick it up and fix it further.


Situation: The Youtube video embedded on my profile will auto play sometimes, maybe every 1/5-7 page loads.


Original embed code:

<iframe width="560" height="315" src="https://www.youtube.com/embed/xqds0B_meys" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>



Solution: add the code "?autoplay=1" after the video url in the code



Fixed Code:

<iframe width="560" height="315" src="https://www.youtube.com/embed/xqds0B_meys?autoplay=1" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>



Conclusion: I feel as though the handshake between spacehey and embeded videos on Youtube is a bit wonky at the moment. Please feel free to add any thoughts on the matter. I will be publishing results in the coming days should I come across anything.



14 Kudos

Comments

Displaying 2 of 2 comments ( View all | Add Comment )

trick

trick's profile picture

mine still wont auto play after refreshing


Report Comment



Heyy sorry about that. So my methodology is kinda clunky so I suggest using this one https://blog.spacehey.com/entry?id=325249

The author goes into good detail and their method works perfectly.

by BrandonBurnsRed; ; Report

Heroin

Heroin's profile picture

Hi it still won't autopay even when i copied your code


Report Comment



Sometimes the feature takes a refresh to get working. I can actually put together a demo video to explain how it works and I will post it in this thread.

by BrandonBurnsRed; ; Report

please create the demo video

by Muritt; ; Report