Ignore interrupted loads

This commit is contained in:
Travis Shivers 2020-06-30 01:00:29 -05:00
parent c090a4fb50
commit 403328e1c5
1 changed files with 13 additions and 4 deletions

View File

@ -279,11 +279,20 @@ export default {
LOAD_PLAYER_SRC: async ({ getters, commit }) => {
// TODO: potentailly unload if already loaded to avoid load interrupted errors
// However, while its loading, potentially reporting the old time...
try {
const result = await getters.GET_PLAYER.load(getters.GET_SRC_URL);
if (getters.GET_OFFSET_MS > 0) {
commit('SET_PLAYER_CURRENT_TIME_MS', getters.GET_OFFSET_MS);
}
return result;
} catch (e) {
// Ignore 7000 error (load interrupted)
if (e.code !== 7000) {
throw e;
}
}
},
INIT_PLAYER_STATE: async ({ rootGetters, commit, dispatch }) => {