From 55fd49bbca1313e1852ba833219227185eea9de6 Mon Sep 17 00:00:00 2001 From: DrPandemic Date: Sun, 5 May 2019 12:09:55 -0400 Subject: [PATCH] Redirect home when video player fails --- src/controllers/videoosd.js | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/controllers/videoosd.js b/src/controllers/videoosd.js index 2bfd39582b..5a31c4ed25 100644 --- a/src/controllers/videoosd.js +++ b/src/controllers/videoosd.js @@ -1227,16 +1227,22 @@ define(["playbackManager", "dom", "inputmanager", "datetime", "itemHelper", "med Emby.Page.setTransparency("full"); }); view.addEventListener("viewshow", function (e) { - events.on(playbackManager, "playerchange", onPlayerChange); - bindToPlayer(playbackManager.getCurrentPlayer()); - dom.addEventListener(document, window.PointerEvent ? "pointermove" : "mousemove", onPointerMove, { - passive: true - }); - showOsd(); - inputManager.on(window, onInputCommand); - dom.addEventListener(window, "keydown", onWindowKeyDown, { - passive: true - }); + try { + events.on(playbackManager, "playerchange", onPlayerChange); + bindToPlayer(playbackManager.getCurrentPlayer()); + dom.addEventListener(document, window.PointerEvent ? "pointermove" : "mousemove", onPointerMove, { + passive: true + }); + showOsd(); + inputManager.on(window, onInputCommand); + dom.addEventListener(window, "keydown", onWindowKeyDown, { + passive: true + }); + } catch(e) { + require(['appRouter'], function(appRouter) { + appRouter.showDirect('/'); + }); + } }); view.addEventListener("viewbeforehide", function () { if (statsOverlay) {