From 373d613e19f21db5381665da5918270309bea10e Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Sun, 8 Apr 2018 19:13:58 -0700 Subject: [PATCH] Un-revert, add duration to llama track It seems the bug I saw (the demo track had an infinite duration), was not a bug in my code, but a bug/change in the latest version of mobile Safari. Undoing the revert, since it doesn't really help, and adding back the channel detection code. --- js/actionTypes.js | 1 + js/config.js | 11 +++++++++- js/index.js | 2 +- js/media/index.js | 51 +++++++++++++++++++++++++++++++++++++------ js/mediaMiddleware.js | 12 +++++++--- js/reducers/media.js | 5 ++++- 6 files changed, 69 insertions(+), 13 deletions(-) diff --git a/js/actionTypes.js b/js/actionTypes.js index 780df0db..060b634b 100644 --- a/js/actionTypes.js +++ b/js/actionTypes.js @@ -65,3 +65,4 @@ export const MEDIA_TAG_REQUEST_FAILED = "MEDIA_TAG_REQUEST_FAILED"; export const NETWORK_CONNECTED = "NETWORK_CONNECTED"; export const NETWORK_DISCONNECTED = "NETWORK_DISCONNECTED"; export const UPDATE_WINDOW_POSITIONS = "UPDATE_WINDOW_POSITIONS"; +export const CHANNEL_COUNT_CHANGED = "CHANNEL_COUNT_CHANGED"; diff --git a/js/config.js b/js/config.js index a15bfc81..38f25d1d 100644 --- a/js/config.js +++ b/js/config.js @@ -23,7 +23,16 @@ export const skinUrl = config.skinUrl === undefined ? skin : config.skinUrl; export const initialTracks = config.initialTracks || [ { metaData: { artist: "DJ Mike Llama", title: "Llama Whippin' Intro" }, - url: llamaAudio + url: llamaAudio, + duration: 5.322286 + }, + { + url: "https://cdn.changelog.com/uploads/podcast/291/the-changelog-291.mp3", + metaData: { + artist: "Changelog Media", + title: "Winamp2-js with Jordan Eldredge" + }, + duration: 4841.038367 } ]; diff --git a/js/index.js b/js/index.js index 65a827ad..c9ef4520 100644 --- a/js/index.js +++ b/js/index.js @@ -48,7 +48,7 @@ function filterBreadcrumbActions(action) { Raven.config(sentryDsn, { /* global COMMITHASH */ - release: COMMITHASH || "DEV" + release: typeof COMMITHASH !== "undefined" ? COMMITHASH : "DEV" }).install(); // Don't prompt user to install Winamp2-js. It's probably not diff --git a/js/media/index.js b/js/media/index.js index 01d45e74..e0df181c 100644 --- a/js/media/index.js +++ b/js/media/index.js @@ -1,6 +1,7 @@ /* Emulate the native