aboutsummaryrefslogtreecommitdiffstats
path: root/src/js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js')
-rw-r--r--src/js/plyr.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js
index 665a8782..41abe085 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -1584,6 +1584,17 @@
// Update source
// Sources are not checked for support so be careful
function _parseSource(sources) {
+ // YouTube
+ if(player.type === "youtube" && typeof sources === "string") {
+ if(sources.indexOf("http") === 0) {
+ player.embed.loadVideoByUrl(sources);
+ }
+ else {
+ player.embed.loadVideoById(sources);
+ }
+ return;
+ }
+
// Pause playback (webkit freaks out)
_pause();