From 3ae972d09e8f4ac34570e7288aa4583e4c49bb22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Sat, 11 Jan 2020 10:46:50 +0100 Subject: [PATCH] urls can be edited while playing; refactoring state split into loading and playing playing state is global radonly defaultmedia, remove useless getter, reorder fns --- src/App.vue | 24 ++++++++----- src/common.ts | 12 +++++++ src/components/Channel.vue | 74 ++++++++++++++++++++------------------ 3 files changed, 68 insertions(+), 42 deletions(-) create mode 100644 src/common.ts diff --git a/src/App.vue b/src/App.vue index 428952f..1cf7e68 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,3 +1,4 @@ +import {PlayingState} from "@/common"; @@ -29,6 +30,7 @@ diff --git a/src/common.ts b/src/common.ts new file mode 100644 index 0000000..a751a65 --- /dev/null +++ b/src/common.ts @@ -0,0 +1,12 @@ +enum LoadingState { + UNLOADED = "unloaded", + LOADING = "loading", + LOADED = "loaded", +} + +enum PlayingState { + STOPPED = "stopped", + PLAYING = "playing" +} + +export {LoadingState, PlayingState}; diff --git a/src/components/Channel.vue b/src/components/Channel.vue index 8eb75d3..d8c4c60 100644 --- a/src/components/Channel.vue +++ b/src/components/Channel.vue @@ -1,13 +1,13 @@