Show different message if Upcoming text isn't available. Assume premiere date has passed

This commit is contained in:
Preston 2020-09-25 10:14:49 -04:00
parent 4f04eb7640
commit 8de0c5fef0
3 changed files with 17 additions and 3 deletions

View File

@ -281,8 +281,14 @@ export default Vue.extend({
this.activeSourceList = this.videoSourceList
}
} else if (this.isUpcoming) {
const startTimestamp = result.videoDetails.liveBroadcastDetails.startTimestamp
if (typeof startTimestamp !== 'undefined') {
const upcomingTimestamp = new Date(result.videoDetails.liveBroadcastDetails.startTimestamp)
this.upcomingTimestamp = upcomingTimestamp.toLocaleString()
} else {
this.upcomingTimestamp = null
}
} else {
this.videoLengthSeconds = parseInt(result.videoDetails.lengthSeconds)
this.videoSourceList = result.player_response.streamingData.formats.reverse()
@ -672,7 +678,7 @@ export default Vue.extend({
handleRouteChange: function () {
clearTimeout(this.playNextTimeout)
if (this.rememberHistory && !this.isLoading && !this.isLive) {
if (this.rememberHistory && !this.isUpcoming && !this.isLoading && !this.isLive) {
const player = this.$refs.videoPlayer.player
if (player !== null && this.saveWatchedProgress) {

View File

@ -43,12 +43,19 @@
class="premiereIcon"
/>
<p
v-if="upcomingTimestamp !== null"
class="premiereText"
>
Premieres on:
<br>
{{ upcomingTimestamp }}
</p>
<p
v-else
class="premiereText"
>
{{ $t("Video.Starting soon, please refresh the page to check again") }}
</p>
</div>
</div>
</div>

View File

@ -377,6 +377,7 @@ Video:
Watching: Watching
Watched: Watched
Autoplay: Autoplay
Starting soon, please refresh the page to check again: Starting soon, please refresh the page to check again
# As in a Live Video
Live: Live
Live Now: Live Now