Trying to help a user who wrote:
“Embedded videos: They slow my computer down if I'm not browsing on a very fast machine. Is there any change I can make to my account so that for my account they're hidden/disabled?”
Any ideas?
Thanks…
Thanks @Jeremy , I appreciate the help.To answer your question, no, there isn't a way. It would require an add-on or change to the embed code. I'll look up my code whenim on a computer.
Not sure, @AndyB , probably YouTube though.More information is required.
Does this happen with one embedded video, or with with many embedded videos on a single page. Are these YouTube videos or another?
Not sure
<div class="{$id}" style="width: 500px; height: 300px; cursor: pointer; text-decoration: underline; background-color: black; color: white; text-align: center;">
<div style="padding-top: 134px;">[Show YouTube Video]</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('div.{$id}').click(function(){
$(this).html('<iframe width="500" height="300" src="http://www.youtube.com/embed/{$id}?wmode=opaque" frameborder="0" allowfullscreen></iframe>');
});
});
</script>
<div class="{$id}" style="width: 500px; height: 300px; cursor: pointer; text-decoration: underline; background-color: black; color: white; text-align: center; background-image: url('http://img.youtube.com/vi/{$id}/0.jpg'); background-position: 10px -29px; position: relative;">
<div style="position: absolute; top: 130px; left: 160px; background-color: white; color: black; padding: 10px; border-radius: 10px;">[Show YouTube Video]</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('div.{$id}').click(function(){
$(this).html('<iframe width="500" height="300" src="http://www.youtube.com/embed/{$id}?wmode=opaque" frameborder="0" allowfullscreen></iframe>');
});
});
</script>
<div class="{$id}" style="width: 500px; height: 300px; cursor: pointer; text-decoration: underline; background-color: black; color: white; text-align: center; background-image: url('http://img.youtube.com/vi/{$id}/0.jpg'); background-position: 10px -29px; position: relative;">
<div style="position: absolute; top: 130px; left: 160px; background-color: white; color: black; padding: 10px; border-radius: 10px;">[Play YouTube Video]</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('div.{$id}').click(function(){
$(this).html('<iframe width="500" height="300" src="http://www.youtube.com/embed/{$id}?wmode=opaque&autoplay=1" frameborder="0" allowfullscreen></iframe>');
});
});
</script>
Another revision, now it autoplays when you click the initial box, rather than two clicks (one to load, one to play):
It seems like YouTube should have an option to recreate this functionality. Maybe they do and I am reinventing the wheel.
Hi @Jake Bunce ,
This is very cool of you to do!
I'm assuming this will affect all pages on the site and everyone will have to click to see the videos?
Thanks,
Allen
Another revision, now it autoplays when you click the initial box, rather than two clicks (one to load, one to play):
Code:<div class="{$id}" style="width: 500px; height: 300px; cursor: pointer; text-decoration: underline; background-color: black; color: white; text-align: center; background-image: url('http://img.youtube.com/vi/{$id}/0.jpg'); background-position: 10px -29px; position: relative;"> <div style="position: absolute; top: 130px; left: 160px; background-color: white; color: black; padding: 10px; border-radius: 10px;">[Play YouTube Video]</div> </div> <script type="text/javascript"> $(document).ready(function(){ $('div.{$id}').click(function(){ $(this).html('<iframe width="500" height="300" src="http://www.youtube.com/embed/{$id}?wmode=opaque&autoplay=1" frameborder="0" allowfullscreen></iframe>'); }); }); </script>
It seems like YouTube should have an option to recreate this functionality. Maybe they do and I am reinventing the wheel.
This is exactly what I've been looking for!
You said that clicking one will load any of the same video on the page - so does this mean any embeds from quotes will also load?
If so, I guess your auto-play option would be a bad idea, right?
Another revision, now it autoplays when you click the initial box, rather than two clicks (one to load, one to play):
Code:<div class="{$id}" style="width: 500px; height: 300px; cursor: pointer; text-decoration: underline; background-color: black; color: white; text-align: center; background-image: url('http://img.youtube.com/vi/{$id}/0.jpg'); background-position: 10px -29px; position: relative;"> <div style="position: absolute; top: 130px; left: 160px; background-color: white; color: black; padding: 10px; border-radius: 10px;">[Play YouTube Video]</div> </div> <script type="text/javascript"> $(document).ready(function(){ $('div.{$id}').click(function(){ $(this).html('<iframe width="500" height="300" src="http://www.youtube.com/embed/{$id}?wmode=opaque&autoplay=1" frameborder="0" allowfullscreen></iframe>'); }); }); </script>
It seems like YouTube should have an option to recreate this functionality. Maybe they do and I am reinventing the wheel.
Another revision, now it autoplays when you click the initial box, rather than two clicks (one to load, one to play):
Code:<div class="{$id}" style="width: 500px; height: 300px; cursor: pointer; text-decoration: underline; background-color: black; color: white; text-align: center; background-image: url('http://img.youtube.com/vi/{$id}/0.jpg'); background-position: 10px -29px; position: relative;"> <div style="position: absolute; top: 130px; left: 160px; background-color: white; color: black; padding: 10px; border-radius: 10px;">[Play YouTube Video]</div> </div> <script type="text/javascript"> $(document).ready(function(){ $('div.{$id}').click(function(){ $(this).html('<iframe width="500" height="300" src="http://www.youtube.com/embed/{$id}?wmode=opaque&autoplay=1" frameborder="0" allowfullscreen></iframe>'); }); }); </script>
It seems like YouTube should have an option to recreate this functionality. Maybe they do and I am reinventing the wheel.
Jake,
I've implemented this--and it's great. Thanks.
However, I note that on the iPad (and perhaps other iOS devices), one still needs to click twice to get the videos to play.
Hi @Jake Bunce i hope you update this for working on xf2.0Another revision, now it autoplays when you click the initial box, rather than two clicks (one to load, one to play):
Code:<div class="{$id}" style="width: 500px; height: 300px; cursor: pointer; text-decoration: underline; background-color: black; color: white; text-align: center; background-image: url('http://img.youtube.com/vi/{$id}/0.jpg'); background-position: 10px -29px; position: relative;"> <div style="position: absolute; top: 130px; left: 160px; background-color: white; color: black; padding: 10px; border-radius: 10px;">[Play YouTube Video]</div> </div> <script type="text/javascript"> $(document).ready(function(){ $('div.{$id}').click(function(){ $(this).html('<iframe width="500" height="300" src="http://www.youtube.com/embed/{$id}?wmode=opaque&autoplay=1" frameborder="0" allowfullscreen></iframe>'); }); }); </script>
It seems like YouTube should have an option to recreate this functionality. Maybe they do and I am reinventing the wheel.
We use essential cookies to make this site work, and optional cookies to enhance your experience.