diff --git a/src/client/scripts/app.js b/src/client/scripts/app.js index f3565a0..3f01710 100644 --- a/src/client/scripts/app.js +++ b/src/client/scripts/app.js @@ -132,7 +132,7 @@ class App { this._videoPlayer.updateOfflineProgress(0, true); }); }, err => { - console.log(err); + console.error("Video player init err:", err); }); } @@ -392,7 +392,7 @@ class App { Toast.create('Caching video for offline.', {tag: 'offline'}); return this._offlineCache.add(name, assetPath, pagePath, drmInfo) .catch(_ => { - console.error(_); + console.error("OfflineCache add:", _); Toast.create('Cancelled download.', {tag: 'offline'}); this._offlineDownloadState = App.VIDEO_DOWNLOAD_STATES.IDLE; }); diff --git a/src/client/scripts/background-fetch-helper.js b/src/client/scripts/background-fetch-helper.js index 0dd5fb9..6b56b42 100644 --- a/src/client/scripts/background-fetch-helper.js +++ b/src/client/scripts/background-fetch-helper.js @@ -67,7 +67,7 @@ class BackgroundFetchHelper { return; } - console.log(assets); + console.log("Assets:", assets); return caches.open(id).then(cache => { const fetches = evt.fetches; diff --git a/src/client/scripts/helpers/offline-cache.js b/src/client/scripts/helpers/offline-cache.js index 106b12b..8f9e1da 100644 --- a/src/client/scripts/helpers/offline-cache.js +++ b/src/client/scripts/helpers/offline-cache.js @@ -183,7 +183,7 @@ class OfflineCache { add (name, assetPath, pagePath, drmInfo) { if (!Constants.SUPPORTS_CACHING) { - return; + return Promise.reject(new Error("does not support caching")); } const assets = []; @@ -346,7 +346,7 @@ class OfflineCache { return this._downloadForeground('prefetch', fetches) .catch(e => { - console.error(e); + console.error("DownloadForeground prefetch", e); }); }) .catch(prefetchErr => { diff --git a/src/client/scripts/helpers/service-worker-installer.js b/src/client/scripts/helpers/service-worker-installer.js index e14e479..eb24e97 100644 --- a/src/client/scripts/helpers/service-worker-installer.js +++ b/src/client/scripts/helpers/service-worker-installer.js @@ -77,7 +77,7 @@ class ServiceWorkerInstaller { }; }; }, function (err) { - console.warn(err); + console.warn("Service worker registration unsuccessful:", err); }); } } diff --git a/src/client/scripts/ranged-response.js b/src/client/scripts/ranged-response.js index ef7d6de..b50210a 100644 --- a/src/client/scripts/ranged-response.js +++ b/src/client/scripts/ranged-response.js @@ -294,7 +294,7 @@ class RangedResponse { start, end, offset); }); } catch (e) { - console.log(e); + console.error("RangedResponses cachedResponses:", e); return new Response(e.message, {status: 400}); }; } diff --git a/src/client/scripts/video-player/video-player.js b/src/client/scripts/video-player/video-player.js index aaad996..6eaa626 100644 --- a/src/client/scripts/video-player/video-player.js +++ b/src/client/scripts/video-player/video-player.js @@ -408,7 +408,7 @@ class VideoPlayer { // Lock the player to the offline stream. const tracks = this._player.getTracks().filter(t => { - console.log(t); + console.log("Track:", t); return t.height === Constants.PREFETCH_VIDEO_HEIGHT; }); @@ -525,7 +525,7 @@ class VideoPlayer { } _startChromecastWatch () { - console.log('_startChromecastWatch'); + console.log('StartChromecastWatch'); if (!VideoPlayer.SUPPORTS_REMOTE_PLAYBACK) { this._videoControls.hideChromecastButton(); return; @@ -533,7 +533,7 @@ class VideoPlayer { this._castVideo.src = this._castSrc; this._castVideo.remote.watchAvailability(available => { - console.log('_startChromecastWatch:' + available); + console.log('StartChromecastWatch:' + available); if (available) { this._videoControls.showChromecastButton(); return; @@ -619,7 +619,7 @@ class VideoPlayer { this._video.play().then(_ => { this._updateVideoControlsWithPlayerState(); }, err => { - console.warn(err); + console.warn("OnPlay:", err); }); } @@ -749,17 +749,17 @@ class VideoPlayer { } _onRemoteConnect () { - console.log('_onRemoteConnect'); + console.log('OnRemoteConnect'); this._videoControls.castConnected = true; } _onRemoteConnecting () { - console.log('_onRemoteConnecting'); + console.log('OnRemoteConnecting'); this._videoControls.castConnecting = true; } _onRemoteDisconnect () { - console.log('_onRemoteDisconnect'); + console.log('OnRemoteDisconnect'); this._videoControls.castConnected = false; }