From 72fe1dbab13367ba99d0ae7ae21da270beb464d7 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Tue, 6 Oct 2020 09:54:34 +0200 Subject: [PATCH] Autofocus on video --- index.html | 3 ++- js/vd.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 4a9f4e5..24eac68 100644 --- a/index.html +++ b/index.html @@ -29,7 +29,8 @@ player = vd.setup(args[0], { v: args[1] + "/manifest.mpd", - t: parseInt(args[2], 10) || 0 + t: parseInt(args[2], 10) || 0, + focus: true }); } else if (time !== undefined ){ player.currentTime(time); diff --git a/js/vd.js b/js/vd.js index fe8e758..512750e 100644 --- a/js/vd.js +++ b/js/vd.js @@ -276,6 +276,10 @@ const vd = (function() { type: 'application/dash+xml' }); + if (args.focus === true) { + player.focus(); + } + player._oldRequestFullscreen = player.requestFullscreen; player.requestFullscreen = function() { var player = document.getElementById(this.id());