Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove Youtube Annotations from mediaelement.js Player?

I have tried adding &iv_load_policy=3 to the end of the YouTube url in multiple ways, but the annotations still show. Is there any way to edit the code so that no annotations will show?

EDIT: CODE BELOW

Files from the MediaElement.js Plugin

Random Video with Annotations: https://www.youtube.com/watch?v=IGz13x5OJ_8

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" ></script>
<script src="mediaelement-and-player.min.js"></script>
<link rel="stylesheet" href="mediaelementplayer.css" />

<script>
$(function(){
   player = new MediaElementPlayer('#video-player');
});
</script>

<video style="width:100%;height:100%;" id="video-player" preload="preload" autoplay="autoplay">
    <source type="video/youtube" src="https://www.youtube.com/watch?v=IGz13x5OJ_8" />   
</video>
like image 590
Thomas Avatar asked Oct 21 '22 06:10

Thomas


1 Answers

The only way I found to suppress YouTube annotations is setting MEJS' YouTube plugin instead of flash (default) like :

$(function () {
    player = new MediaElementPlayer('#video-player', {
        plugins: ['youtube']
    });
});

The only inconvenience is that autoplay doesn't work (haven't found the option yet) but at least the main issue is solved ;)

See JSFIDDLE

like image 77
JFK Avatar answered Oct 23 '22 02:10

JFK