Speed up with many projekktors? (Projekktor Core)

by uli, Monday, July 23, 2012, 17:07 (306 days ago)

I've created an overview with 20 or more videos on one page. Each video has an unique ID, everything works. But the site is very slow, because I use the javascript function after each projekktor like this:


<video id="vid1" class="projekktor" width="360" height="202" controls poster="vid1.jpg" preload="none">
<source src="vid1.mp4" type='video/mp4'>
<source src="vid1.webm" type='video/webm'>
<source src="vid1.ogv" type='video/ogg'>
</video>
<script type="text/javascript">
$(document).ready(function() {
  projekktor('#vid1');
}
);
</script>

...

<video id="vid2" class="projekktor" width="360" height="202" controls poster="vid2.jpg" preload="none">
<source src="vid2.mp4" type='video/mp4'>
<source src="vid2.webm" type='video/webm'>
<source src="vid2.ogv" type='video/ogg'>
</video>
<script type="text/javascript">
$(document).ready(function() {
  projekktor('#vid2');
}
);
</script>

...

Is it possible to make the site faster just with one function call?

Thanks,
Uli

  572 views

Complete thread:

 RSS Feed of thread