mirror of
https://github.com/jellyfin/jellyfin-vue.git
synced 2024-11-27 16:20:36 +00:00
fix: remove request progress from progress reports & other fixes
This commit is contained in:
parent
0514f2e7a3
commit
a34eed1cf7
@ -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;
|
||||
|
||||
|
@ -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",
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
@error="handleShakaPlayerError"
|
||||
/>
|
||||
|
||||
<v-dialog v-model="errorDialog" :width="errorModalWidth">
|
||||
<v-dialog v-model="errorDialog" :width="smallModalWidth">
|
||||
<v-card>
|
||||
<v-card-title class="headline">
|
||||
{{ $t('errors.anErrorHappened') }}
|
||||
|
Loading…
Reference in New Issue
Block a user