aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plyr.youtube.js
blob: 0b28460acfc6afc350a749a17a8006216127bb56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// ==========================================================================
// Plyr
// plyr.youtube.js v1.1.4
// https://github.com/selz/plyr
// License: The MIT License (MIT)
// ==========================================================================

(function (api) {
    "use strict";

    api.youtube = {
    	setup: function() {
    		console.log("Setup youtube");
    		console.log(this);

    		var player = this;

    		// Find child <source> elements
            var sources = player.media.querySelectorAll("source");

            // Remove each
            for (var i = sources.length - 1; i >= 0; i--) {
                var source = sources[i];

                if(source.type == "video/youtube") {
                	console.log(source.src);
                }
            }
    	}
    };

}(this.plyr.plugins = this.plyr.plugins || {}));