diff --git a/components/VideoPlayer.vue b/components/VideoPlayer.vue index 5e20e27d..0dbae174 100644 --- a/components/VideoPlayer.vue +++ b/components/VideoPlayer.vue @@ -151,16 +151,19 @@ export default Vue.extend({ ...mapActions('snackbar', ['pushSnackbarMessage']), onVideoPlaying(_event: Event) { // TODO: Move to playback manager - this.$api.playState.reportPlaybackStart({ - playbackStartInfo: { - CanSeek: true, - ItemId: this.item.Id, - PlaySessionId: this.playbackInfo.PlaySessionId, - MediaSourceId: this.playbackInfo.MediaSources?.[0].Id, - AudioStreamIndex: 0, // TODO: Don't hardcode this - SubtitleStreamIndex: 0 // TODO: Don't hardcode this - } - }); + this.$api.playState.reportPlaybackStart( + { + playbackStartInfo: { + CanSeek: true, + ItemId: this.item.Id, + PlaySessionId: this.playbackInfo.PlaySessionId, + MediaSourceId: this.playbackInfo.MediaSources?.[0].Id, + AudioStreamIndex: 0, // TODO: Don't hardcode this + SubtitleStreamIndex: 0 // TODO: Don't hardcode this + } + }, + { progress: false } + ); this.lastProgressUpdate = new Date().getTime(); }, @@ -168,18 +171,21 @@ export default Vue.extend({ // TODO: Move to playback manager const now = new Date().getTime(); - if (!(now - this.lastProgressUpdate < 700)) { + if (now - this.lastProgressUpdate > 1000) { const currentTime = (this.$refs.videoPlayer as HTMLVideoElement) .currentTime; - this.$api.playState.reportPlaybackProgress({ - playbackProgressInfo: { - ItemId: this.item.Id, - PlaySessionId: this.playbackInfo.PlaySessionId, - IsPaused: false, - PositionTicks: Math.round(this.msToTicks(currentTime * 1000)) - } - }); + this.$api.playState.reportPlaybackProgress( + { + playbackProgressInfo: { + ItemId: this.item.Id, + PlaySessionId: this.playbackInfo.PlaySessionId, + IsPaused: false, + PositionTicks: Math.round(this.msToTicks(currentTime * 1000)) + } + }, + { progress: false } + ); this.lastProgressUpdate = new Date().getTime(); } @@ -189,27 +195,33 @@ export default Vue.extend({ const currentTime = (this.$refs.videoPlayer as HTMLVideoElement) .currentTime; - this.$api.playState.reportPlaybackProgress({ - playbackProgressInfo: { - ItemId: this.item.Id, - PlaySessionId: this.playbackInfo.PlaySessionId, - IsPaused: true, - PositionTicks: Math.round(this.msToTicks(currentTime * 1000)) - } - }); + this.$api.playState.reportPlaybackProgress( + { + playbackProgressInfo: { + ItemId: this.item.Id, + PlaySessionId: this.playbackInfo.PlaySessionId, + IsPaused: true, + PositionTicks: Math.round(this.msToTicks(currentTime * 1000)) + } + }, + { progress: false } + ); }, onVideoStopped(_event?: Event) { // TODO: Move to playback manager const currentTime = (this.$refs.videoPlayer as HTMLVideoElement) .currentTime; - this.$api.playState.reportPlaybackStopped({ - playbackStopInfo: { - ItemId: this.item.Id, - PlaySessionId: this.playbackInfo.PlaySessionId, - PositionTicks: this.msToTicks(currentTime * 1000) - } - }); + this.$api.playState.reportPlaybackStopped( + { + playbackStopInfo: { + ItemId: this.item.Id, + PlaySessionId: this.playbackInfo.PlaySessionId, + PositionTicks: this.msToTicks(currentTime * 1000) + } + }, + { progress: false } + ); this.lastProgressUpdate = 0; diff --git a/locales/en-US.json b/locales/en-US.json index 2e1939d5..c5dd2900 100644 --- a/locales/en-US.json +++ b/locales/en-US.json @@ -8,7 +8,7 @@ "biography": "Biography", "browserNotSupported": "Your browser is not supported for playing this file.", "buttons": { - "ok": "OK" + "ok": "Ok" }, "byArtist": "By", "changeServer": "Change server", diff --git a/mixins/modalHelper.ts b/mixins/modalHelper.ts index 3ef2414c..ca8c9d9d 100644 --- a/mixins/modalHelper.ts +++ b/mixins/modalHelper.ts @@ -7,35 +7,25 @@ import Vue from 'vue'; declare module '@nuxt/types' { interface Context { - errorModalWidth: () => string | number; + smallModalWidth: () => string | number; } interface NuxtAppOptions { - errorModalWidth: () => string | number; + smallModalWidth: () => string | number; } } declare module 'vue/types/vue' { interface Vue { - errorModalWidth: () => string | number; + smallModalWidth: () => string | number; } } const modalHelper = Vue.extend({ computed: { - errorModalWidth(): string | number { + smallModalWidth(): string | number { if (this.$vuetify.breakpoint.smAndDown) { return '90%'; - } else if ( - this.$vuetify.breakpoint.smAndUp && - !this.$vuetify.breakpoint.mdAndUp - ) { - return 600; - } else if ( - this.$vuetify.breakpoint.mdAndUp && - !this.$vuetify.breakpoint.lgAndUp - ) { - return 600; } else { return 600; } diff --git a/pages/item/_itemId/play.vue b/pages/item/_itemId/play.vue index 9fe90594..d0357091 100644 --- a/pages/item/_itemId/play.vue +++ b/pages/item/_itemId/play.vue @@ -7,7 +7,7 @@ @error="handleShakaPlayerError" /> - + {{ $t('errors.anErrorHappened') }}