2021-11-01 21:06:51 -05:00
|
|
|
<template>
|
2023-01-11 17:02:18 -06:00
|
|
|
<div v-if="playbackSession" id="streamContainer" class="fixed top-0 left-0 layout-wrapper right-0 z-50 pointer-events-none" :class="{ fullscreen: showFullscreen, 'ios-player': $platform === 'ios', 'web-player': $platform === 'web' }">
|
|
|
|
<div v-if="showFullscreen" class="w-full h-full z-10 absolute top-0 left-0 pointer-events-auto" :style="{ backgroundColor: coverRgb }">
|
2023-12-10 17:53:27 -06:00
|
|
|
<div class="w-full h-full absolute top-0 left-0 pointer-events-none" style="background: var(--gradient-audio-player)" />
|
2023-01-11 17:02:18 -06:00
|
|
|
|
2022-12-04 09:19:50 -06:00
|
|
|
<div class="top-4 left-4 absolute cursor-pointer">
|
2023-01-11 17:02:18 -06:00
|
|
|
<span class="material-icons text-5xl" :class="{ 'text-black text-opacity-75': coverBgIsLight }" @click="collapseFullscreen">expand_more</span>
|
2021-11-01 21:06:51 -05:00
|
|
|
</div>
|
2022-12-04 09:19:50 -06:00
|
|
|
<div v-show="showCastBtn" class="top-6 right-16 absolute cursor-pointer">
|
2023-01-11 17:02:18 -06:00
|
|
|
<span class="material-icons text-3xl" :class="isCasting ? (coverBgIsLight ? 'text-successDark' : 'text-success') : coverBgIsLight ? 'text-black' : ''" @click="castClick">cast</span>
|
2021-11-20 19:25:01 -06:00
|
|
|
</div>
|
2022-12-04 09:19:50 -06:00
|
|
|
<div class="top-6 right-4 absolute cursor-pointer">
|
2023-01-11 17:02:18 -06:00
|
|
|
<span class="material-icons text-3xl" :class="{ 'text-black text-opacity-75': coverBgIsLight }" @click="showMoreMenuDialog = true">more_vert</span>
|
2021-12-11 13:20:20 -06:00
|
|
|
</div>
|
2023-12-04 17:53:36 -06:00
|
|
|
<p class="top-4 absolute left-0 right-0 mx-auto text-center uppercase tracking-widest text-opacity-75" :class="{ 'text-black text-opacity-75': coverBgIsLight }" style="font-size: 10px">{{ isDirectPlayMethod ? $strings.LabelPlaybackDirect : isLocalPlayMethod ? $strings.LabelPlaybackLocal : $strings.LabelPlaybackTranscode }}</p>
|
2021-12-11 13:20:20 -06:00
|
|
|
</div>
|
|
|
|
|
2023-03-04 16:26:37 -06:00
|
|
|
<div v-if="useChapterTrack && useTotalTrack && showFullscreen" class="absolute total-track w-full z-30 px-6">
|
2021-12-11 13:20:20 -06:00
|
|
|
<div class="flex">
|
2023-12-10 17:53:27 -06:00
|
|
|
<p class="font-mono text-fg" style="font-size: 0.8rem">{{ currentTimePretty }}</p>
|
2021-12-11 13:20:20 -06:00
|
|
|
<div class="flex-grow" />
|
2023-12-10 17:53:27 -06:00
|
|
|
<p class="font-mono text-fg" style="font-size: 0.8rem">{{ totalTimeRemainingPretty }}</p>
|
2021-12-11 13:20:20 -06:00
|
|
|
</div>
|
|
|
|
<div class="w-full">
|
2023-03-04 13:59:37 -06:00
|
|
|
<div class="h-1 w-full bg-gray-500 bg-opacity-50 relative rounded-full">
|
|
|
|
<div ref="totalReadyTrack" class="h-full bg-gray-600 absolute top-0 left-0 pointer-events-none rounded-full" />
|
|
|
|
<div ref="totalBufferedTrack" class="h-full bg-gray-500 absolute top-0 left-0 pointer-events-none rounded-full" />
|
|
|
|
<div ref="totalPlayedTrack" class="h-full bg-gray-200 absolute top-0 left-0 pointer-events-none rounded-full" />
|
2021-12-11 13:20:20 -06:00
|
|
|
</div>
|
2021-11-01 21:06:51 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2022-06-23 19:27:41 -05:00
|
|
|
<div class="cover-wrapper absolute z-30 pointer-events-auto" @click="clickContainer">
|
2023-01-11 17:02:18 -06:00
|
|
|
<div class="w-full h-full flex justify-center">
|
2023-02-27 16:30:18 -06:00
|
|
|
<covers-book-cover v-if="libraryItem || localLibraryItemCoverSrc" ref="cover" :library-item="libraryItem" :download-cover="localLibraryItemCoverSrc" :width="bookCoverWidth" :book-cover-aspect-ratio="bookCoverAspectRatio" raw @imageLoaded="coverImageLoaded" />
|
2021-11-01 21:06:51 -05:00
|
|
|
</div>
|
2022-07-19 18:50:14 -05:00
|
|
|
|
|
|
|
<div v-if="syncStatus === $constants.SyncStatus.FAILED" class="absolute top-0 left-0 w-full h-full flex items-center justify-center z-30">
|
|
|
|
<span class="material-icons text-error text-3xl">error</span>
|
|
|
|
</div>
|
2021-11-01 21:06:51 -05:00
|
|
|
</div>
|
|
|
|
|
2022-07-02 15:40:37 -05:00
|
|
|
<div class="title-author-texts absolute z-30 left-0 right-0 overflow-hidden" @click="clickTitleAndAuthor">
|
2023-01-12 17:04:47 -06:00
|
|
|
<p class="title-text truncate">{{ title }}</p>
|
2023-12-10 17:53:27 -06:00
|
|
|
<p class="author-text text-fg text-opacity-75 truncate">{{ authorName }}</p>
|
2021-11-01 21:06:51 -05:00
|
|
|
</div>
|
|
|
|
|
2023-01-11 17:02:18 -06:00
|
|
|
<div id="playerContent" class="playerContainer w-full z-20 absolute bottom-0 left-0 right-0 p-2 pointer-events-auto transition-all" :style="{ backgroundColor: showFullscreen ? '' : coverRgb }" @click="clickContainer">
|
2023-03-04 16:42:06 -06:00
|
|
|
<div v-if="showFullscreen" class="absolute bottom-4 left-0 right-0 w-full pb-4 pt-2 mx-auto px-6" style="max-width: 414px">
|
2021-11-01 21:06:51 -05:00
|
|
|
<div class="flex items-center justify-between pointer-events-auto">
|
2023-12-10 17:53:27 -06:00
|
|
|
<span v-if="!isPodcast && serverLibraryItemId && networkConnected" class="material-icons text-3xl text-fg-muted cursor-pointer" @click="$emit('showBookmarks')">{{ bookmarks.length ? 'bookmark' : 'bookmark_border' }}</span>
|
2022-04-15 20:48:39 -05:00
|
|
|
<!-- hidden for podcasts but still using this as a placeholder -->
|
|
|
|
<span v-else class="material-icons text-3xl text-white text-opacity-0">bookmark</span>
|
|
|
|
|
2023-12-10 17:53:27 -06:00
|
|
|
<span class="font-mono text-fg-muted cursor-pointer" style="font-size: 1.35rem" @click="$emit('selectPlaybackSpeed')">{{ currentPlaybackRate }}x</span>
|
|
|
|
<svg v-if="!sleepTimerRunning" xmlns="http://www.w3.org/2000/svg" class="h-7 w-7 text-fg-muted cursor-pointer" fill="none" viewBox="0 0 24 24" stroke="currentColor" @click.stop="$emit('showSleepTimer')">
|
2021-11-01 21:06:51 -05:00
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" />
|
|
|
|
</svg>
|
|
|
|
<div v-else class="h-7 w-7 flex items-center justify-around cursor-pointer" @click.stop="$emit('showSleepTimer')">
|
2021-11-26 18:27:18 -06:00
|
|
|
<p class="text-xl font-mono text-success">{{ sleepTimeRemainingPretty }}</p>
|
2021-11-01 21:06:51 -05:00
|
|
|
</div>
|
|
|
|
|
2023-12-10 17:53:27 -06:00
|
|
|
<span class="material-icons text-3xl text-fg cursor-pointer" :class="chapters.length ? 'text-opacity-75' : 'text-opacity-10'" @click="clickChaptersBtn">format_list_bulleted</span>
|
2021-11-01 21:06:51 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-12-10 17:53:27 -06:00
|
|
|
<div v-else class="w-full h-full absolute top-0 left-0 pointer-events-none" style="background: var(--gradient-minimized-audio-player)" />
|
2021-11-01 21:06:51 -05:00
|
|
|
|
2023-03-04 16:42:06 -06:00
|
|
|
<div id="playerControls" class="absolute right-0 bottom-0 mx-auto" style="max-width: 414px">
|
2023-03-10 15:37:42 -06:00
|
|
|
<div class="flex items-center max-w-full" :class="lockUi ? 'justify-center' : 'justify-between'">
|
2023-12-10 17:53:27 -06:00
|
|
|
<span v-show="showFullscreen && !lockUi" class="material-icons next-icon text-fg cursor-pointer" :class="isLoading ? 'text-opacity-10' : 'text-opacity-75'" @click.stop="jumpChapterStart">first_page</span>
|
|
|
|
<span v-show="!lockUi" class="material-icons jump-icon text-fg cursor-pointer" :class="isLoading ? 'text-opacity-10' : 'text-opacity-75'" @click.stop="jumpBackwards">{{ jumpBackwardsIcon }}</span>
|
2023-01-12 17:04:47 -06:00
|
|
|
<div class="play-btn cursor-pointer shadow-sm flex items-center justify-center rounded-full text-primary mx-4 relative overflow-hidden" :style="{ backgroundColor: coverRgb }" :class="{ 'animate-spin': seekLoading }" @mousedown.prevent @mouseup.prevent @click.stop="playPauseClick">
|
2023-01-12 17:12:14 -06:00
|
|
|
<div v-if="!coverBgIsLight" class="absolute top-0 left-0 w-full h-full bg-white bg-opacity-20 pointer-events-none" />
|
2023-01-12 17:04:47 -06:00
|
|
|
|
|
|
|
<span v-if="!isLoading" class="material-icons" :class="{ 'text-white': coverRgb && !coverBgIsLight }">{{ seekLoading ? 'autorenew' : !isPlaying ? 'play_arrow' : 'pause' }}</span>
|
2021-11-02 19:44:42 -05:00
|
|
|
<widgets-spinner-icon v-else class="h-8 w-8" />
|
2021-11-01 21:06:51 -05:00
|
|
|
</div>
|
2023-12-10 17:53:27 -06:00
|
|
|
<span v-show="!lockUi" class="material-icons jump-icon text-fg cursor-pointer" :class="isLoading ? 'text-opacity-10' : 'text-opacity-75'" @click.stop="jumpForward">{{ jumpForwardIcon }}</span>
|
|
|
|
<span v-show="showFullscreen && !lockUi" class="material-icons next-icon text-fg cursor-pointer" :class="nextChapter && !isLoading ? 'text-opacity-75' : 'text-opacity-10'" @click.stop="jumpNextChapter">last_page</span>
|
2021-11-01 21:06:51 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2023-03-04 16:26:37 -06:00
|
|
|
<div id="playerTrack" class="absolute left-0 w-full px-6">
|
2023-03-04 17:15:48 -06:00
|
|
|
<div class="flex pointer-events-none">
|
2023-12-10 17:53:27 -06:00
|
|
|
<p class="font-mono text-fg" style="font-size: 0.8rem" ref="currentTimestamp">0:00</p>
|
2023-01-08 14:31:37 -06:00
|
|
|
<div class="flex-grow" />
|
2023-12-10 17:53:27 -06:00
|
|
|
<p class="font-mono text-fg" style="font-size: 0.8rem">{{ timeRemainingPretty }}</p>
|
2023-01-08 14:31:37 -06:00
|
|
|
</div>
|
2023-03-04 16:26:37 -06:00
|
|
|
<div ref="track" class="h-1.5 w-full bg-gray-500 bg-opacity-50 relative rounded-full" :class="{ 'animate-pulse': isLoading }" @click.stop>
|
|
|
|
<div ref="readyTrack" class="h-full bg-gray-600 absolute top-0 left-0 rounded-full pointer-events-none" />
|
|
|
|
<div ref="bufferedTrack" class="h-full bg-gray-500 absolute top-0 left-0 rounded-full pointer-events-none" />
|
|
|
|
<div ref="playedTrack" class="h-full bg-gray-200 absolute top-0 left-0 rounded-full pointer-events-none" />
|
2023-06-11 14:20:33 -05:00
|
|
|
<div ref="trackCursor" class="h-7 w-7 rounded-full absolute pointer-events-auto flex items-center justify-center" :style="{ top: '-11px' }" :class="{ 'opacity-0': lockUi || !showFullscreen }" @touchstart="touchstartCursor">
|
|
|
|
<div class="bg-gray-200 rounded-full w-3.5 h-3.5 pointer-events-none" />
|
|
|
|
</div>
|
2021-11-01 21:06:51 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-04-02 12:12:00 -05:00
|
|
|
|
2023-06-01 17:36:52 -05:00
|
|
|
<modals-chapters-modal v-model="showChapterModal" :current-chapter="currentChapter" :chapters="chapters" :playback-rate="currentPlaybackRate" @select="selectChapter" />
|
2023-01-16 23:54:23 +01:00
|
|
|
<modals-dialog v-model="showMoreMenuDialog" :items="menuItems" @action="clickMenuAction" />
|
2021-11-01 21:06:51 -05:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-04-02 12:12:00 -05:00
|
|
|
import { Capacitor } from '@capacitor/core'
|
2022-04-04 19:08:27 -05:00
|
|
|
import { AbsAudioPlayer } from '@/plugins/capacitor'
|
2023-01-11 17:02:18 -06:00
|
|
|
import { FastAverageColor } from 'fast-average-color'
|
2021-11-01 21:06:51 -05:00
|
|
|
|
|
|
|
export default {
|
|
|
|
props: {
|
2021-11-02 19:44:42 -05:00
|
|
|
bookmarks: {
|
|
|
|
type: Array,
|
|
|
|
default: () => []
|
|
|
|
},
|
2021-11-01 21:06:51 -05:00
|
|
|
sleepTimerRunning: Boolean,
|
2022-12-11 11:09:50 -06:00
|
|
|
sleepTimeRemaining: Number,
|
2023-09-11 17:08:15 -05:00
|
|
|
serverLibraryItemId: String
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2022-06-23 19:27:41 -05:00
|
|
|
windowHeight: 0,
|
2023-01-08 13:27:09 -06:00
|
|
|
windowWidth: 0,
|
2022-04-02 12:12:00 -05:00
|
|
|
playbackSession: null,
|
|
|
|
showChapterModal: false,
|
2021-11-01 21:06:51 -05:00
|
|
|
showFullscreen: false,
|
|
|
|
totalDuration: 0,
|
|
|
|
currentPlaybackRate: 1,
|
|
|
|
currentTime: 0,
|
2021-12-19 12:40:52 -06:00
|
|
|
bufferedTime: 0,
|
2021-11-01 21:06:51 -05:00
|
|
|
playInterval: null,
|
|
|
|
trackWidth: 0,
|
2022-04-11 18:38:01 -05:00
|
|
|
isPlaying: false,
|
|
|
|
isEnded: false,
|
2021-11-01 21:06:51 -05:00
|
|
|
volume: 0.5,
|
|
|
|
readyTrackWidth: 0,
|
|
|
|
seekedTime: 0,
|
|
|
|
seekLoading: false,
|
2022-04-02 12:12:00 -05:00
|
|
|
onPlaybackSessionListener: null,
|
|
|
|
onPlaybackClosedListener: null,
|
2021-11-01 21:06:51 -05:00
|
|
|
onPlayingUpdateListener: null,
|
|
|
|
onMetadataListener: null,
|
2022-07-19 18:50:14 -05:00
|
|
|
onProgressSyncFailing: null,
|
|
|
|
onProgressSyncSuccess: null,
|
2023-02-06 17:20:39 -06:00
|
|
|
onPlaybackSpeedChangedListener: null,
|
2021-11-01 21:06:51 -05:00
|
|
|
touchStartY: 0,
|
|
|
|
touchStartTime: 0,
|
2021-11-19 20:00:34 -06:00
|
|
|
touchEndY: 0,
|
2022-03-28 19:53:53 -05:00
|
|
|
useChapterTrack: false,
|
2023-01-17 00:54:17 +01:00
|
|
|
useTotalTrack: true,
|
2022-08-22 16:50:20 -05:00
|
|
|
lockUi: false,
|
2022-05-29 18:13:25 -05:00
|
|
|
isLoading: false,
|
2023-03-04 16:26:37 -06:00
|
|
|
isDraggingCursor: false,
|
|
|
|
draggingTouchStartX: 0,
|
|
|
|
draggingTouchStartTime: 0,
|
|
|
|
draggingCurrentTime: 0,
|
2022-08-22 16:02:35 -05:00
|
|
|
syncStatus: 0,
|
2023-01-11 17:02:18 -06:00
|
|
|
showMoreMenuDialog: false,
|
|
|
|
coverRgb: 'rgb(55, 56, 56)',
|
|
|
|
coverBgIsLight: false
|
2021-11-01 21:06:51 -05:00
|
|
|
}
|
|
|
|
},
|
2022-06-23 19:27:41 -05:00
|
|
|
watch: {
|
2022-07-04 15:42:59 -05:00
|
|
|
showFullscreen(val) {
|
2022-06-23 19:27:41 -05:00
|
|
|
this.updateScreenSize()
|
2022-07-04 15:42:59 -05:00
|
|
|
this.$store.commit('setPlayerFullscreen', !!val)
|
2023-01-08 13:50:18 -06:00
|
|
|
},
|
|
|
|
bookCoverAspectRatio() {
|
|
|
|
this.updateScreenSize()
|
2022-06-23 19:27:41 -05:00
|
|
|
}
|
|
|
|
},
|
2021-11-01 21:06:51 -05:00
|
|
|
computed: {
|
2021-12-11 13:20:20 -06:00
|
|
|
menuItems() {
|
2023-01-15 16:33:51 -06:00
|
|
|
const items = []
|
|
|
|
// TODO: Implement on iOS
|
|
|
|
if (this.$platform !== 'ios' && !this.isPodcast && this.mediaId) {
|
|
|
|
items.push({
|
2023-12-04 17:53:36 -06:00
|
|
|
text: this.$strings.ButtonHistory,
|
2023-01-16 23:54:23 +01:00
|
|
|
value: 'history',
|
|
|
|
icon: 'history'
|
2023-01-15 16:33:51 -06:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
items.push(
|
|
|
|
...[
|
2023-01-17 00:54:17 +01:00
|
|
|
{
|
2023-12-04 17:53:36 -06:00
|
|
|
text: this.$strings.LabelTotalTrack,
|
2023-01-17 00:54:17 +01:00
|
|
|
value: 'total_track',
|
|
|
|
icon: this.useTotalTrack ? 'check_box' : 'check_box_outline_blank'
|
|
|
|
},
|
2023-01-15 16:33:51 -06:00
|
|
|
{
|
2023-12-04 17:53:36 -06:00
|
|
|
text: this.$strings.LabelChapterTrack,
|
2023-01-15 16:33:51 -06:00
|
|
|
value: 'chapter_track',
|
|
|
|
icon: this.useChapterTrack ? 'check_box' : 'check_box_outline_blank'
|
|
|
|
},
|
|
|
|
{
|
2023-12-04 17:53:36 -06:00
|
|
|
text: this.lockUi ? this.$strings.LabelUnlockPlayer : this.$strings.LabelLockPlayer,
|
2023-01-15 16:33:51 -06:00
|
|
|
value: 'lock',
|
|
|
|
icon: this.lockUi ? 'lock' : 'lock_open'
|
|
|
|
},
|
|
|
|
{
|
2023-12-04 17:53:36 -06:00
|
|
|
text: this.$strings.LabelClosePlayer,
|
2023-01-15 16:33:51 -06:00
|
|
|
value: 'close',
|
|
|
|
icon: 'close'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
)
|
2022-08-22 16:50:20 -05:00
|
|
|
|
2021-12-11 13:20:20 -06:00
|
|
|
return items
|
|
|
|
},
|
2022-07-01 20:05:11 -05:00
|
|
|
jumpForwardIcon() {
|
|
|
|
return this.$store.getters['globals/getJumpForwardIcon'](this.jumpForwardTime)
|
|
|
|
},
|
|
|
|
jumpBackwardsIcon() {
|
|
|
|
return this.$store.getters['globals/getJumpBackwardsIcon'](this.jumpBackwardsTime)
|
|
|
|
},
|
|
|
|
jumpForwardTime() {
|
|
|
|
return this.$store.getters['getJumpForwardTime']
|
|
|
|
},
|
|
|
|
jumpBackwardsTime() {
|
|
|
|
return this.$store.getters['getJumpBackwardsTime']
|
|
|
|
},
|
2021-12-05 18:31:47 -06:00
|
|
|
bookCoverAspectRatio() {
|
2022-10-22 08:59:10 -05:00
|
|
|
return this.$store.getters['libraries/getBookCoverAspectRatio']
|
2021-12-05 18:31:47 -06:00
|
|
|
},
|
|
|
|
bookCoverWidth() {
|
2022-06-23 19:27:41 -05:00
|
|
|
if (this.showFullscreen) return this.fullscreenBookCoverWidth
|
2022-12-04 09:19:50 -06:00
|
|
|
return 46 / this.bookCoverAspectRatio
|
2022-06-23 19:27:41 -05:00
|
|
|
},
|
|
|
|
fullscreenBookCoverWidth() {
|
2023-01-08 13:27:09 -06:00
|
|
|
if (this.windowWidth < this.windowHeight) {
|
|
|
|
// Portrait
|
|
|
|
let sideSpace = 20
|
|
|
|
if (this.bookCoverAspectRatio === 1.6) sideSpace += (this.windowWidth - sideSpace) * 0.375
|
2023-01-24 17:52:28 -06:00
|
|
|
|
|
|
|
const availableHeight = this.windowHeight - 400
|
|
|
|
let width = this.windowWidth - sideSpace
|
|
|
|
const totalHeight = width * this.bookCoverAspectRatio
|
|
|
|
if (totalHeight > availableHeight) {
|
|
|
|
width = availableHeight / this.bookCoverAspectRatio
|
|
|
|
}
|
|
|
|
return width
|
2023-01-08 13:27:09 -06:00
|
|
|
} else {
|
|
|
|
// Landscape
|
|
|
|
const heightScale = (this.windowHeight - 200) / 651
|
|
|
|
if (this.bookCoverAspectRatio === 1) {
|
|
|
|
return 260 * heightScale
|
|
|
|
}
|
|
|
|
return 190 * heightScale
|
2021-12-05 18:31:47 -06:00
|
|
|
}
|
|
|
|
},
|
2022-04-17 18:14:45 -05:00
|
|
|
showCastBtn() {
|
2022-05-04 19:31:56 -05:00
|
|
|
return this.$store.state.isCastAvailable
|
2022-04-17 18:14:45 -05:00
|
|
|
},
|
2022-04-17 16:59:49 -05:00
|
|
|
isCasting() {
|
|
|
|
return this.mediaPlayer === 'cast-player'
|
|
|
|
},
|
|
|
|
mediaPlayer() {
|
|
|
|
return this.playbackSession ? this.playbackSession.mediaPlayer : null
|
|
|
|
},
|
2022-04-15 20:48:39 -05:00
|
|
|
mediaType() {
|
|
|
|
return this.playbackSession ? this.playbackSession.mediaType : null
|
|
|
|
},
|
|
|
|
isPodcast() {
|
|
|
|
return this.mediaType === 'podcast'
|
|
|
|
},
|
2022-03-28 19:53:53 -05:00
|
|
|
mediaMetadata() {
|
2022-04-02 12:12:00 -05:00
|
|
|
return this.playbackSession ? this.playbackSession.mediaMetadata : null
|
|
|
|
},
|
|
|
|
libraryItem() {
|
|
|
|
return this.playbackSession ? this.playbackSession.libraryItem || null : null
|
|
|
|
},
|
2022-04-05 19:44:14 -05:00
|
|
|
localLibraryItem() {
|
|
|
|
return this.playbackSession ? this.playbackSession.localLibraryItem || null : null
|
2022-04-02 12:12:00 -05:00
|
|
|
},
|
2022-04-05 19:44:14 -05:00
|
|
|
localLibraryItemCoverSrc() {
|
2023-06-03 17:24:32 -05:00
|
|
|
var localItemCover = this.localLibraryItem?.coverContentUrl || null
|
2022-04-05 19:44:14 -05:00
|
|
|
if (localItemCover) return Capacitor.convertFileSrc(localItemCover)
|
2022-04-02 12:12:00 -05:00
|
|
|
return null
|
|
|
|
},
|
|
|
|
playMethod() {
|
|
|
|
return this.playbackSession ? this.playbackSession.playMethod : null
|
|
|
|
},
|
|
|
|
isLocalPlayMethod() {
|
|
|
|
return this.playMethod == this.$constants.PlayMethod.LOCAL
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
2022-05-04 19:31:56 -05:00
|
|
|
isDirectPlayMethod() {
|
|
|
|
return this.playMethod == this.$constants.PlayMethod.DIRECTPLAY
|
|
|
|
},
|
2021-11-01 21:06:51 -05:00
|
|
|
title() {
|
2023-03-04 13:49:58 -06:00
|
|
|
if (this.currentChapterTitle && this.showFullscreen) return this.currentChapterTitle
|
2022-04-02 12:12:00 -05:00
|
|
|
if (this.playbackSession) return this.playbackSession.displayTitle
|
|
|
|
return this.mediaMetadata ? this.mediaMetadata.title : 'Title'
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
2022-03-28 19:53:53 -05:00
|
|
|
authorName() {
|
2022-04-02 12:12:00 -05:00
|
|
|
if (this.playbackSession) return this.playbackSession.displayAuthor
|
|
|
|
return this.mediaMetadata ? this.mediaMetadata.authorName : 'Author'
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
|
|
|
chapters() {
|
2022-04-02 12:12:00 -05:00
|
|
|
if (this.playbackSession && this.playbackSession.chapters) {
|
|
|
|
return this.playbackSession.chapters
|
|
|
|
}
|
|
|
|
return []
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
|
|
|
currentChapter() {
|
2022-04-02 12:12:00 -05:00
|
|
|
if (!this.chapters.length) return null
|
2022-01-13 15:44:16 -06:00
|
|
|
return this.chapters.find((ch) => Number(Number(ch.start).toFixed(2)) <= this.currentTime && Number(Number(ch.end).toFixed(2)) > this.currentTime)
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
2021-11-02 19:44:42 -05:00
|
|
|
nextChapter() {
|
|
|
|
if (!this.chapters.length) return
|
2022-01-13 15:44:16 -06:00
|
|
|
return this.chapters.find((c) => Number(Number(c.start).toFixed(2)) > this.currentTime)
|
2021-11-02 19:44:42 -05:00
|
|
|
},
|
2021-11-01 21:06:51 -05:00
|
|
|
currentChapterTitle() {
|
|
|
|
return this.currentChapter ? this.currentChapter.title : ''
|
|
|
|
},
|
2021-12-11 13:20:20 -06:00
|
|
|
currentChapterDuration() {
|
|
|
|
return this.currentChapter ? this.currentChapter.end - this.currentChapter.start : this.totalDuration
|
|
|
|
},
|
2021-11-01 21:06:51 -05:00
|
|
|
totalDurationPretty() {
|
|
|
|
return this.$secondsToTimestamp(this.totalDuration)
|
|
|
|
},
|
2021-12-11 13:20:20 -06:00
|
|
|
currentTimePretty() {
|
2023-03-04 16:26:37 -06:00
|
|
|
let currentTimeToUse = this.isDraggingCursor ? this.draggingCurrentTime : this.currentTime
|
|
|
|
return this.$secondsToTimestamp(currentTimeToUse / this.currentPlaybackRate)
|
2021-12-11 13:20:20 -06:00
|
|
|
},
|
2021-11-26 18:27:18 -06:00
|
|
|
timeRemaining() {
|
2023-03-04 16:26:37 -06:00
|
|
|
let currentTimeToUse = this.isDraggingCursor ? this.draggingCurrentTime : this.currentTime
|
2021-12-11 13:20:20 -06:00
|
|
|
if (this.useChapterTrack && this.currentChapter) {
|
2023-03-04 16:26:37 -06:00
|
|
|
var currChapTime = currentTimeToUse - this.currentChapter.start
|
2021-12-11 13:20:20 -06:00
|
|
|
return (this.currentChapterDuration - currChapTime) / this.currentPlaybackRate
|
|
|
|
}
|
|
|
|
return this.totalTimeRemaining
|
|
|
|
},
|
|
|
|
totalTimeRemaining() {
|
2023-03-04 16:26:37 -06:00
|
|
|
let currentTimeToUse = this.isDraggingCursor ? this.draggingCurrentTime : this.currentTime
|
|
|
|
return (this.totalDuration - currentTimeToUse) / this.currentPlaybackRate
|
2021-11-26 18:27:18 -06:00
|
|
|
},
|
2021-12-11 13:20:20 -06:00
|
|
|
totalTimeRemainingPretty() {
|
|
|
|
if (this.totalTimeRemaining < 0) {
|
|
|
|
return this.$secondsToTimestamp(this.totalTimeRemaining * -1)
|
|
|
|
}
|
|
|
|
return '-' + this.$secondsToTimestamp(this.totalTimeRemaining)
|
|
|
|
},
|
2021-11-26 18:27:18 -06:00
|
|
|
timeRemainingPretty() {
|
|
|
|
if (this.timeRemaining < 0) {
|
|
|
|
return this.$secondsToTimestamp(this.timeRemaining * -1)
|
|
|
|
}
|
|
|
|
return '-' + this.$secondsToTimestamp(this.timeRemaining)
|
|
|
|
},
|
|
|
|
sleepTimeRemainingPretty() {
|
|
|
|
if (!this.sleepTimeRemaining) return '0s'
|
|
|
|
var secondsRemaining = Math.round(this.sleepTimeRemaining)
|
|
|
|
if (secondsRemaining > 91) {
|
|
|
|
return Math.ceil(secondsRemaining / 60) + 'm'
|
|
|
|
} else {
|
|
|
|
return secondsRemaining + 's'
|
|
|
|
}
|
2022-12-11 11:09:50 -06:00
|
|
|
},
|
|
|
|
networkConnected() {
|
|
|
|
return this.$store.state.networkConnected
|
2023-01-15 16:33:51 -06:00
|
|
|
},
|
|
|
|
mediaId() {
|
|
|
|
if (this.isPodcast || !this.playbackSession) return null
|
|
|
|
if (this.playbackSession.libraryItemId) {
|
|
|
|
return this.playbackSession.episodeId ? `${this.playbackSession.libraryItemId}-${this.playbackSession.episodeId}` : this.playbackSession.libraryItemId
|
|
|
|
}
|
|
|
|
const localLibraryItem = this.playbackSession.localLibraryItem
|
|
|
|
if (!localLibraryItem) return null
|
|
|
|
|
|
|
|
return this.playbackSession.localEpisodeId ? `${localLibraryItem.id}-${this.playbackSession.localEpisodeId}` : localLibraryItem.id
|
2021-11-01 21:06:51 -05:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
2023-05-20 16:31:51 -05:00
|
|
|
clickChaptersBtn() {
|
|
|
|
if (!this.chapters.length) return
|
|
|
|
this.showChapterModal = true
|
|
|
|
},
|
2023-01-11 17:02:18 -06:00
|
|
|
async coverImageLoaded(fullCoverUrl) {
|
|
|
|
if (!fullCoverUrl) return
|
|
|
|
|
|
|
|
const fac = new FastAverageColor()
|
|
|
|
fac
|
|
|
|
.getColorAsync(fullCoverUrl)
|
|
|
|
.then((color) => {
|
|
|
|
this.coverRgb = color.rgba
|
|
|
|
this.coverBgIsLight = color.isLight
|
|
|
|
})
|
|
|
|
.catch((e) => {
|
|
|
|
console.log(e)
|
|
|
|
})
|
|
|
|
},
|
2022-07-02 15:40:37 -05:00
|
|
|
clickTitleAndAuthor() {
|
|
|
|
if (!this.showFullscreen) return
|
2023-09-11 17:08:15 -05:00
|
|
|
const llid = this.serverLibraryItemId || this.libraryItem?.id || this.localLibraryItem?.id
|
2022-07-02 15:40:37 -05:00
|
|
|
if (llid) {
|
|
|
|
this.$router.push(`/item/${llid}`)
|
|
|
|
this.showFullscreen = false
|
|
|
|
}
|
|
|
|
},
|
2022-12-08 00:28:28 -05:00
|
|
|
async selectChapter(chapter) {
|
2023-01-08 15:32:15 -06:00
|
|
|
await this.$hapticsImpact()
|
2022-04-02 12:12:00 -05:00
|
|
|
this.seek(chapter.start)
|
|
|
|
this.showChapterModal = false
|
|
|
|
},
|
2022-12-08 00:28:28 -05:00
|
|
|
async castClick() {
|
2023-01-08 15:32:15 -06:00
|
|
|
await this.$hapticsImpact()
|
2022-04-17 16:59:49 -05:00
|
|
|
if (this.isLocalPlayMethod) {
|
2022-05-04 19:31:56 -05:00
|
|
|
this.$eventBus.$emit('cast-local-item')
|
2022-04-17 16:59:49 -05:00
|
|
|
return
|
|
|
|
}
|
2022-04-04 19:08:27 -05:00
|
|
|
AbsAudioPlayer.requestSession()
|
2021-11-20 19:25:01 -06:00
|
|
|
},
|
2021-11-01 21:06:51 -05:00
|
|
|
clickContainer() {
|
|
|
|
this.showFullscreen = true
|
2021-12-11 13:20:20 -06:00
|
|
|
|
|
|
|
// Update track for total time bar if useChapterTrack is set
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.updateTrack()
|
|
|
|
})
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
|
|
|
collapseFullscreen() {
|
|
|
|
this.showFullscreen = false
|
2022-01-05 19:09:18 -06:00
|
|
|
this.forceCloseDropdownMenu()
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
2022-12-08 00:28:28 -05:00
|
|
|
async jumpNextChapter() {
|
2023-01-08 15:32:15 -06:00
|
|
|
await this.$hapticsImpact()
|
2022-03-28 19:53:53 -05:00
|
|
|
if (this.isLoading) return
|
2021-11-01 21:06:51 -05:00
|
|
|
if (!this.nextChapter) return
|
|
|
|
this.seek(this.nextChapter.start)
|
|
|
|
},
|
2022-12-08 00:28:28 -05:00
|
|
|
async jumpChapterStart() {
|
2023-01-08 15:32:15 -06:00
|
|
|
await this.$hapticsImpact()
|
2022-03-28 19:53:53 -05:00
|
|
|
if (this.isLoading) return
|
2021-11-01 21:06:51 -05:00
|
|
|
if (!this.currentChapter) {
|
|
|
|
return this.restart()
|
|
|
|
}
|
2021-11-02 19:44:42 -05:00
|
|
|
|
2022-04-02 19:43:43 -05:00
|
|
|
// If 4 seconds or less into current chapter, then go to previous
|
|
|
|
if (this.currentTime - this.currentChapter.start <= 4) {
|
2022-12-11 10:49:05 -06:00
|
|
|
const currChapterIndex = this.chapters.findIndex((ch) => Number(ch.start) <= this.currentTime && Number(ch.end) >= this.currentTime)
|
2021-11-02 19:44:42 -05:00
|
|
|
if (currChapterIndex > 0) {
|
2022-12-11 10:49:05 -06:00
|
|
|
const prevChapter = this.chapters[currChapterIndex - 1]
|
2021-11-02 19:44:42 -05:00
|
|
|
this.seek(prevChapter.start)
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.seek(this.currentChapter.start)
|
|
|
|
}
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
|
|
|
showSleepTimerModal() {
|
|
|
|
this.$emit('showSleepTimer')
|
|
|
|
},
|
2022-12-08 00:28:28 -05:00
|
|
|
async setPlaybackSpeed(speed) {
|
2021-11-02 19:44:42 -05:00
|
|
|
console.log(`[AudioPlayer] Set Playback Rate: ${speed}`)
|
|
|
|
this.currentPlaybackRate = speed
|
2023-02-04 13:50:54 -06:00
|
|
|
this.updateTimestamp()
|
2022-04-11 18:38:01 -05:00
|
|
|
AbsAudioPlayer.setPlaybackSpeed({ value: speed })
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
|
|
|
restart() {
|
|
|
|
this.seek(0)
|
|
|
|
},
|
2022-12-08 00:28:28 -05:00
|
|
|
async jumpBackwards() {
|
2023-01-08 15:32:15 -06:00
|
|
|
await this.$hapticsImpact()
|
2022-03-28 19:53:53 -05:00
|
|
|
if (this.isLoading) return
|
2022-07-01 20:05:11 -05:00
|
|
|
AbsAudioPlayer.seekBackward({ value: this.jumpBackwardsTime })
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
2022-12-08 00:28:28 -05:00
|
|
|
async jumpForward() {
|
2023-01-08 15:32:15 -06:00
|
|
|
await this.$hapticsImpact()
|
2022-03-28 19:53:53 -05:00
|
|
|
if (this.isLoading) return
|
2022-07-01 20:05:11 -05:00
|
|
|
AbsAudioPlayer.seekForward({ value: this.jumpForwardTime })
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
|
|
|
setStreamReady() {
|
|
|
|
this.readyTrackWidth = this.trackWidth
|
2021-12-11 13:20:20 -06:00
|
|
|
this.updateReadyTrack()
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
|
|
|
setChunksReady(chunks, numSegments) {
|
2022-12-11 10:49:05 -06:00
|
|
|
let largestSeg = 0
|
2021-11-01 21:06:51 -05:00
|
|
|
for (let i = 0; i < chunks.length; i++) {
|
2022-12-11 10:49:05 -06:00
|
|
|
const chunk = chunks[i]
|
2021-11-01 21:06:51 -05:00
|
|
|
if (typeof chunk === 'string') {
|
2022-12-11 10:49:05 -06:00
|
|
|
const chunkRange = chunk.split('-').map((c) => Number(c))
|
2021-11-01 21:06:51 -05:00
|
|
|
if (chunkRange.length < 2) continue
|
|
|
|
if (chunkRange[1] > largestSeg) largestSeg = chunkRange[1]
|
|
|
|
} else if (chunk > largestSeg) {
|
|
|
|
largestSeg = chunk
|
|
|
|
}
|
|
|
|
}
|
2022-12-11 10:49:05 -06:00
|
|
|
const percentageReady = largestSeg / numSegments
|
|
|
|
const widthReady = Math.round(this.trackWidth * percentageReady)
|
2021-11-01 21:06:51 -05:00
|
|
|
if (this.readyTrackWidth === widthReady) {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
this.readyTrackWidth = widthReady
|
2021-12-11 13:20:20 -06:00
|
|
|
this.updateReadyTrack()
|
|
|
|
},
|
|
|
|
updateReadyTrack() {
|
|
|
|
if (this.useChapterTrack) {
|
|
|
|
if (this.$refs.totalReadyTrack) {
|
|
|
|
this.$refs.totalReadyTrack.style.width = this.readyTrackWidth + 'px'
|
|
|
|
}
|
|
|
|
this.$refs.readyTrack.style.width = this.trackWidth + 'px'
|
|
|
|
} else {
|
|
|
|
this.$refs.readyTrack.style.width = this.readyTrackWidth + 'px'
|
|
|
|
}
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
|
|
|
updateTimestamp() {
|
2023-02-04 13:50:54 -06:00
|
|
|
const ts = this.$refs.currentTimestamp
|
2021-11-01 21:06:51 -05:00
|
|
|
if (!ts) {
|
|
|
|
console.error('No timestamp el')
|
|
|
|
return
|
|
|
|
}
|
2023-03-04 16:26:37 -06:00
|
|
|
|
|
|
|
let currentTime = this.isDraggingCursor ? this.draggingCurrentTime : this.currentTime
|
2021-12-11 13:20:20 -06:00
|
|
|
if (this.useChapterTrack && this.currentChapter) {
|
2023-03-04 16:26:37 -06:00
|
|
|
currentTime = Math.max(0, currentTime - this.currentChapter.start)
|
2021-12-11 13:20:20 -06:00
|
|
|
}
|
2023-03-04 16:26:37 -06:00
|
|
|
|
|
|
|
ts.innerText = this.$secondsToTimestamp(currentTime / this.currentPlaybackRate)
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
|
|
|
timeupdate() {
|
|
|
|
if (!this.$refs.playedTrack) {
|
|
|
|
console.error('Invalid no played track ref')
|
|
|
|
return
|
|
|
|
}
|
2021-11-26 18:27:18 -06:00
|
|
|
this.$emit('updateTime', this.currentTime)
|
2021-11-01 21:06:51 -05:00
|
|
|
|
|
|
|
if (this.seekLoading) {
|
|
|
|
this.seekLoading = false
|
|
|
|
if (this.$refs.playedTrack) {
|
|
|
|
this.$refs.playedTrack.classList.remove('bg-yellow-300')
|
|
|
|
this.$refs.playedTrack.classList.add('bg-gray-200')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this.updateTimestamp()
|
2021-12-11 13:20:20 -06:00
|
|
|
this.updateTrack()
|
|
|
|
},
|
|
|
|
updateTrack() {
|
2022-04-11 18:38:01 -05:00
|
|
|
// Update progress track UI
|
2023-03-04 16:26:37 -06:00
|
|
|
let currentTimeToUse = this.isDraggingCursor ? this.draggingCurrentTime : this.currentTime
|
|
|
|
let percentDone = currentTimeToUse / this.totalDuration
|
2022-12-11 10:49:05 -06:00
|
|
|
const totalPercentDone = percentDone
|
|
|
|
let bufferedPercent = this.bufferedTime / this.totalDuration
|
|
|
|
const totalBufferedPercent = bufferedPercent
|
2021-12-19 12:40:52 -06:00
|
|
|
|
2021-12-11 13:20:20 -06:00
|
|
|
if (this.useChapterTrack && this.currentChapter) {
|
2023-03-04 16:26:37 -06:00
|
|
|
const currChapTime = currentTimeToUse - this.currentChapter.start
|
2021-12-11 13:20:20 -06:00
|
|
|
percentDone = currChapTime / this.currentChapterDuration
|
2022-07-04 18:42:43 -05:00
|
|
|
bufferedPercent = Math.max(0, Math.min(1, (this.bufferedTime - this.currentChapter.start) / this.currentChapterDuration))
|
2021-12-11 13:20:20 -06:00
|
|
|
}
|
2023-03-04 16:26:37 -06:00
|
|
|
|
2022-12-11 10:49:05 -06:00
|
|
|
const ptWidth = Math.round(percentDone * this.trackWidth)
|
2021-11-01 21:06:51 -05:00
|
|
|
this.$refs.playedTrack.style.width = ptWidth + 'px'
|
2021-12-19 12:40:52 -06:00
|
|
|
this.$refs.bufferedTrack.style.width = Math.round(bufferedPercent * this.trackWidth) + 'px'
|
2021-12-11 13:20:20 -06:00
|
|
|
|
2022-08-22 16:50:20 -05:00
|
|
|
if (this.$refs.trackCursor) {
|
2023-06-11 14:20:33 -05:00
|
|
|
this.$refs.trackCursor.style.left = ptWidth - 14 + 'px'
|
2022-08-22 16:50:20 -05:00
|
|
|
}
|
|
|
|
|
2021-12-11 13:20:20 -06:00
|
|
|
if (this.useChapterTrack) {
|
2021-12-19 18:58:26 -06:00
|
|
|
if (this.$refs.totalPlayedTrack) this.$refs.totalPlayedTrack.style.width = Math.round(totalPercentDone * this.trackWidth) + 'px'
|
|
|
|
if (this.$refs.totalBufferedTrack) this.$refs.totalBufferedTrack.style.width = Math.round(totalBufferedPercent * this.trackWidth) + 'px'
|
2021-12-11 13:20:20 -06:00
|
|
|
}
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
|
|
|
seek(time) {
|
2022-03-28 19:53:53 -05:00
|
|
|
if (this.isLoading) return
|
2021-11-01 21:06:51 -05:00
|
|
|
if (this.seekLoading) {
|
|
|
|
console.error('Already seek loading', this.seekedTime)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
this.seekedTime = time
|
|
|
|
this.seekLoading = true
|
2022-04-11 18:38:01 -05:00
|
|
|
|
|
|
|
AbsAudioPlayer.seek({ value: Math.floor(time) })
|
2021-11-01 21:06:51 -05:00
|
|
|
|
|
|
|
if (this.$refs.playedTrack) {
|
2023-06-19 12:37:44 -05:00
|
|
|
const perc = time / this.totalDuration
|
|
|
|
const ptWidth = Math.round(perc * this.trackWidth)
|
2021-11-01 21:06:51 -05:00
|
|
|
this.$refs.playedTrack.style.width = ptWidth + 'px'
|
|
|
|
|
|
|
|
this.$refs.playedTrack.classList.remove('bg-gray-200')
|
|
|
|
this.$refs.playedTrack.classList.add('bg-yellow-300')
|
|
|
|
}
|
|
|
|
},
|
2023-03-04 16:26:37 -06:00
|
|
|
async touchstartCursor(e) {
|
|
|
|
if (!e || !e.touches || !this.$refs.track || !this.showFullscreen || this.lockUi) return
|
2023-03-04 17:15:48 -06:00
|
|
|
|
2023-03-04 16:26:37 -06:00
|
|
|
await this.$hapticsImpact()
|
|
|
|
this.isDraggingCursor = true
|
|
|
|
this.draggingTouchStartX = e.touches[0].pageX
|
|
|
|
this.draggingTouchStartTime = this.currentTime
|
|
|
|
this.draggingCurrentTime = this.currentTime
|
|
|
|
this.updateTrack()
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
2022-04-10 16:46:09 -05:00
|
|
|
async playPauseClick() {
|
2023-01-08 15:32:15 -06:00
|
|
|
await this.$hapticsImpact()
|
2022-03-28 19:53:53 -05:00
|
|
|
if (this.isLoading) return
|
2022-04-11 18:38:01 -05:00
|
|
|
|
2022-04-10 16:46:09 -05:00
|
|
|
this.isPlaying = !!((await AbsAudioPlayer.playPause()) || {}).playing
|
2022-04-11 18:38:01 -05:00
|
|
|
this.isEnded = false
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
|
|
|
play() {
|
2022-04-04 19:08:27 -05:00
|
|
|
AbsAudioPlayer.playPlayer()
|
2021-11-01 21:06:51 -05:00
|
|
|
this.startPlayInterval()
|
2021-11-26 18:27:18 -06:00
|
|
|
this.isPlaying = true
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
|
|
|
pause() {
|
2022-04-04 19:08:27 -05:00
|
|
|
AbsAudioPlayer.pausePlayer()
|
2021-11-01 21:06:51 -05:00
|
|
|
this.stopPlayInterval()
|
2021-11-26 18:27:18 -06:00
|
|
|
this.isPlaying = false
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
|
|
|
startPlayInterval() {
|
|
|
|
clearInterval(this.playInterval)
|
|
|
|
this.playInterval = setInterval(async () => {
|
2022-04-04 19:08:27 -05:00
|
|
|
var data = await AbsAudioPlayer.getCurrentTime()
|
2022-04-11 18:38:01 -05:00
|
|
|
this.currentTime = Number(data.value.toFixed(2))
|
|
|
|
this.bufferedTime = Number(data.bufferedTime.toFixed(2))
|
2021-11-01 21:06:51 -05:00
|
|
|
this.timeupdate()
|
|
|
|
}, 1000)
|
|
|
|
},
|
|
|
|
stopPlayInterval() {
|
|
|
|
clearInterval(this.playInterval)
|
|
|
|
},
|
|
|
|
resetStream(startTime) {
|
2022-04-11 18:38:01 -05:00
|
|
|
this.closePlayback()
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
2022-04-11 18:38:01 -05:00
|
|
|
handleGesture() {
|
|
|
|
var touchDistance = this.touchEndY - this.touchStartY
|
|
|
|
if (touchDistance > 100) {
|
|
|
|
this.collapseFullscreen()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
touchstart(e) {
|
|
|
|
if (!this.showFullscreen || !e.changedTouches) return
|
|
|
|
|
|
|
|
this.touchStartY = e.changedTouches[0].screenY
|
|
|
|
if (this.touchStartY > window.innerHeight / 3) {
|
|
|
|
// console.log('touch too low')
|
|
|
|
return
|
|
|
|
}
|
|
|
|
this.touchStartTime = Date.now()
|
|
|
|
},
|
|
|
|
touchend(e) {
|
2022-05-29 18:13:25 -05:00
|
|
|
if (!e.changedTouches) return
|
2022-04-11 18:38:01 -05:00
|
|
|
|
2023-03-04 16:26:37 -06:00
|
|
|
if (this.isDraggingCursor) {
|
|
|
|
if (this.draggingCurrentTime !== this.currentTime) {
|
|
|
|
this.seek(this.draggingCurrentTime)
|
2022-05-29 18:13:25 -05:00
|
|
|
}
|
2023-03-04 16:26:37 -06:00
|
|
|
this.isDraggingCursor = false
|
2022-05-29 18:13:25 -05:00
|
|
|
} else if (this.showFullscreen) {
|
|
|
|
this.touchEndY = e.changedTouches[0].screenY
|
|
|
|
var touchDuration = Date.now() - this.touchStartTime
|
|
|
|
if (touchDuration > 1200) {
|
|
|
|
// console.log('touch too long', touchDuration)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
this.handleGesture()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
touchmove(e) {
|
2023-03-04 16:26:37 -06:00
|
|
|
if (!this.isDraggingCursor || !e.touches) return
|
2022-05-29 18:13:25 -05:00
|
|
|
|
2023-03-04 16:26:37 -06:00
|
|
|
const distanceMoved = e.touches[0].pageX - this.draggingTouchStartX
|
|
|
|
let duration = this.totalDuration
|
|
|
|
let minTime = 0
|
|
|
|
let maxTime = duration
|
|
|
|
if (this.useChapterTrack && this.currentChapter) {
|
|
|
|
duration = this.currentChapterDuration
|
|
|
|
minTime = this.currentChapter.start
|
|
|
|
maxTime = minTime + duration
|
2022-05-29 18:13:25 -05:00
|
|
|
}
|
|
|
|
|
2023-03-04 16:26:37 -06:00
|
|
|
const timePerPixel = duration / this.trackWidth
|
|
|
|
const newTime = this.draggingTouchStartTime + timePerPixel * distanceMoved
|
|
|
|
this.draggingCurrentTime = Math.min(maxTime, Math.max(minTime, newTime))
|
|
|
|
|
|
|
|
this.updateTimestamp()
|
|
|
|
this.updateTrack()
|
2022-04-11 18:38:01 -05:00
|
|
|
},
|
2022-12-08 00:28:28 -05:00
|
|
|
async clickMenuAction(action) {
|
2023-01-08 15:32:15 -06:00
|
|
|
await this.$hapticsImpact()
|
2022-08-22 16:02:35 -05:00
|
|
|
this.showMoreMenuDialog = false
|
2022-08-25 18:04:14 -05:00
|
|
|
this.$nextTick(() => {
|
2023-01-15 16:33:51 -06:00
|
|
|
if (action === 'history') {
|
|
|
|
this.$router.push(`/media/${this.mediaId}/history?title=${this.title}`)
|
|
|
|
this.showFullscreen = false
|
|
|
|
} else if (action === 'lock') {
|
2022-08-25 18:04:14 -05:00
|
|
|
this.lockUi = !this.lockUi
|
|
|
|
this.$localStore.setPlayerLock(this.lockUi)
|
|
|
|
} else if (action === 'chapter_track') {
|
|
|
|
this.useChapterTrack = !this.useChapterTrack
|
2023-01-17 00:54:17 +01:00
|
|
|
this.useTotalTrack = !this.useChapterTrack || this.useTotalTrack
|
2022-04-11 18:38:01 -05:00
|
|
|
|
|
|
|
this.updateTimestamp()
|
|
|
|
this.updateTrack()
|
|
|
|
this.updateReadyTrack()
|
2023-06-18 14:53:01 -05:00
|
|
|
this.$localStore.setUseTotalTrack(this.useTotalTrack)
|
2022-08-25 18:04:14 -05:00
|
|
|
this.$localStore.setUseChapterTrack(this.useChapterTrack)
|
2023-01-17 00:54:17 +01:00
|
|
|
} else if (action === 'total_track') {
|
|
|
|
this.useTotalTrack = !this.useTotalTrack
|
|
|
|
this.useChapterTrack = !this.useTotalTrack || this.useChapterTrack
|
|
|
|
|
|
|
|
this.updateTimestamp()
|
|
|
|
this.updateTrack()
|
|
|
|
this.updateReadyTrack()
|
|
|
|
this.$localStore.setUseTotalTrack(this.useTotalTrack)
|
2023-06-18 14:53:01 -05:00
|
|
|
this.$localStore.setUseChapterTrack(this.useChapterTrack)
|
2022-08-25 18:04:14 -05:00
|
|
|
} else if (action === 'close') {
|
|
|
|
this.closePlayback()
|
|
|
|
}
|
|
|
|
})
|
2022-04-11 18:38:01 -05:00
|
|
|
},
|
|
|
|
forceCloseDropdownMenu() {
|
|
|
|
if (this.$refs.dropdownMenu && this.$refs.dropdownMenu.closeMenu) {
|
|
|
|
this.$refs.dropdownMenu.closeMenu()
|
|
|
|
}
|
2021-11-01 21:06:51 -05:00
|
|
|
},
|
2022-04-16 13:36:30 -05:00
|
|
|
closePlayback() {
|
2022-04-21 18:50:01 -05:00
|
|
|
this.endPlayback()
|
|
|
|
AbsAudioPlayer.closePlayback()
|
|
|
|
},
|
|
|
|
endPlayback() {
|
2023-06-19 12:37:44 -05:00
|
|
|
this.$store.commit('setPlaybackSession', null)
|
2022-04-16 13:36:30 -05:00
|
|
|
this.showFullscreen = false
|
|
|
|
this.isEnded = false
|
2022-04-19 19:25:16 -05:00
|
|
|
this.isLoading = false
|
2022-04-16 13:36:30 -05:00
|
|
|
this.playbackSession = null
|
|
|
|
},
|
2022-04-11 18:38:01 -05:00
|
|
|
//
|
|
|
|
// Listeners from audio AbsAudioPlayer
|
|
|
|
//
|
2021-11-01 21:06:51 -05:00
|
|
|
onPlayingUpdate(data) {
|
2022-03-28 19:53:53 -05:00
|
|
|
console.log('onPlayingUpdate', JSON.stringify(data))
|
2022-04-11 18:38:01 -05:00
|
|
|
this.isPlaying = !!data.value
|
|
|
|
this.$store.commit('setPlayerPlaying', this.isPlaying)
|
|
|
|
if (this.isPlaying) {
|
2021-11-01 21:06:51 -05:00
|
|
|
this.startPlayInterval()
|
|
|
|
} else {
|
|
|
|
this.stopPlayInterval()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onMetadata(data) {
|
2022-03-28 19:53:53 -05:00
|
|
|
console.log('onMetadata', JSON.stringify(data))
|
2022-04-02 19:43:43 -05:00
|
|
|
this.totalDuration = Number(data.duration.toFixed(2))
|
2022-04-11 18:38:01 -05:00
|
|
|
this.currentTime = Number(data.currentTime.toFixed(2))
|
2021-11-01 21:06:51 -05:00
|
|
|
|
2022-04-19 19:25:16 -05:00
|
|
|
// Done loading
|
|
|
|
if (data.playerState !== 'BUFFERING' && data.playerState !== 'IDLE') {
|
|
|
|
this.isLoading = false
|
|
|
|
}
|
|
|
|
|
|
|
|
if (data.playerState === 'ENDED') {
|
2022-04-11 18:38:01 -05:00
|
|
|
console.log('[AudioPlayer] Playback ended')
|
2021-11-01 21:06:51 -05:00
|
|
|
}
|
2022-04-19 19:25:16 -05:00
|
|
|
this.isEnded = data.playerState === 'ENDED'
|
2021-11-01 21:06:51 -05:00
|
|
|
|
2022-04-15 20:48:39 -05:00
|
|
|
console.log('received metadata update', data)
|
|
|
|
|
2021-11-01 21:06:51 -05:00
|
|
|
this.timeupdate()
|
|
|
|
},
|
2022-04-02 12:12:00 -05:00
|
|
|
// When a playback session is started the native android/ios will send the session
|
|
|
|
onPlaybackSession(playbackSession) {
|
|
|
|
console.log('onPlaybackSession received', JSON.stringify(playbackSession))
|
|
|
|
this.playbackSession = playbackSession
|
|
|
|
|
2022-04-11 18:38:01 -05:00
|
|
|
this.isEnded = false
|
2022-04-19 19:25:16 -05:00
|
|
|
this.isLoading = true
|
2022-07-19 18:50:14 -05:00
|
|
|
this.syncStatus = 0
|
2023-06-19 12:37:44 -05:00
|
|
|
this.$store.commit('setPlaybackSession', this.playbackSession)
|
2022-04-10 20:31:47 -05:00
|
|
|
|
2022-04-02 12:12:00 -05:00
|
|
|
// Set track width
|
|
|
|
this.$nextTick(() => {
|
|
|
|
if (this.$refs.track) {
|
|
|
|
this.trackWidth = this.$refs.track.clientWidth
|
|
|
|
} else {
|
|
|
|
console.error('Track not loaded', this.$refs)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
onPlaybackClosed() {
|
2022-04-21 18:50:01 -05:00
|
|
|
this.endPlayback()
|
2022-04-16 13:36:30 -05:00
|
|
|
},
|
|
|
|
onPlaybackFailed(data) {
|
|
|
|
console.log('Received onPlaybackFailed evt')
|
|
|
|
var errorMessage = data.value || 'Unknown Error'
|
|
|
|
this.$toast.error(`Playback Failed: ${errorMessage}`)
|
2022-04-21 18:50:01 -05:00
|
|
|
this.endPlayback()
|
2022-04-02 12:12:00 -05:00
|
|
|
},
|
2023-02-06 17:20:39 -06:00
|
|
|
onPlaybackSpeedChanged(data) {
|
|
|
|
if (!data.value || isNaN(data.value)) return
|
|
|
|
this.currentPlaybackRate = Number(data.value)
|
|
|
|
this.updateTimestamp()
|
|
|
|
},
|
2021-12-11 13:20:20 -06:00
|
|
|
async init() {
|
|
|
|
this.useChapterTrack = await this.$localStore.getUseChapterTrack()
|
2023-06-18 14:53:01 -05:00
|
|
|
this.useTotalTrack = await this.$localStore.getUseTotalTrack()
|
2022-08-22 16:50:20 -05:00
|
|
|
this.lockUi = await this.$localStore.getPlayerLock()
|
2021-12-11 13:20:20 -06:00
|
|
|
|
2022-04-04 19:08:27 -05:00
|
|
|
this.onPlaybackSessionListener = AbsAudioPlayer.addListener('onPlaybackSession', this.onPlaybackSession)
|
|
|
|
this.onPlaybackClosedListener = AbsAudioPlayer.addListener('onPlaybackClosed', this.onPlaybackClosed)
|
2022-04-16 13:36:30 -05:00
|
|
|
this.onPlaybackFailedListener = AbsAudioPlayer.addListener('onPlaybackFailed', this.onPlaybackFailed)
|
2022-04-04 19:08:27 -05:00
|
|
|
this.onPlayingUpdateListener = AbsAudioPlayer.addListener('onPlayingUpdate', this.onPlayingUpdate)
|
|
|
|
this.onMetadataListener = AbsAudioPlayer.addListener('onMetadata', this.onMetadata)
|
2022-07-19 18:50:14 -05:00
|
|
|
this.onProgressSyncFailing = AbsAudioPlayer.addListener('onProgressSyncFailing', this.showProgressSyncIsFailing)
|
|
|
|
this.onProgressSyncSuccess = AbsAudioPlayer.addListener('onProgressSyncSuccess', this.showProgressSyncSuccess)
|
2023-02-06 17:20:39 -06:00
|
|
|
this.onPlaybackSpeedChangedListener = AbsAudioPlayer.addListener('onPlaybackSpeedChanged', this.onPlaybackSpeedChanged)
|
2022-06-23 19:27:41 -05:00
|
|
|
},
|
|
|
|
screenOrientationChange() {
|
2022-12-11 10:49:05 -06:00
|
|
|
setTimeout(() => {
|
|
|
|
this.updateScreenSize()
|
2022-12-11 12:01:54 -06:00
|
|
|
if (this.$refs.track) {
|
|
|
|
this.trackWidth = this.$refs.track.clientWidth
|
|
|
|
this.updateTrack()
|
|
|
|
this.updateReadyTrack()
|
|
|
|
}
|
2022-12-11 10:49:05 -06:00
|
|
|
}, 50)
|
2022-06-23 19:27:41 -05:00
|
|
|
},
|
|
|
|
updateScreenSize() {
|
|
|
|
this.windowHeight = window.innerHeight
|
2023-01-08 13:27:09 -06:00
|
|
|
this.windowWidth = window.innerWidth
|
2022-12-04 09:19:50 -06:00
|
|
|
const coverHeight = this.fullscreenBookCoverWidth * this.bookCoverAspectRatio
|
2023-01-08 13:50:18 -06:00
|
|
|
const coverImageWidthCollapsed = 46 / this.bookCoverAspectRatio
|
2022-06-23 19:27:41 -05:00
|
|
|
document.documentElement.style.setProperty('--cover-image-width', this.fullscreenBookCoverWidth + 'px')
|
|
|
|
document.documentElement.style.setProperty('--cover-image-height', coverHeight + 'px')
|
2023-01-08 13:50:18 -06:00
|
|
|
document.documentElement.style.setProperty('--cover-image-width-collapsed', coverImageWidthCollapsed + 'px')
|
|
|
|
document.documentElement.style.setProperty('--cover-image-height-collapsed', 46 + 'px')
|
2023-03-04 16:26:37 -06:00
|
|
|
document.documentElement.style.setProperty('--title-author-left-offset-collapsed', 30 + coverImageWidthCollapsed + 'px')
|
2022-07-04 15:42:59 -05:00
|
|
|
},
|
|
|
|
minimizePlayerEvt() {
|
2023-01-31 14:50:26 -06:00
|
|
|
this.collapseFullscreen()
|
2022-07-19 18:50:14 -05:00
|
|
|
},
|
|
|
|
showProgressSyncIsFailing() {
|
|
|
|
this.syncStatus = this.$constants.SyncStatus.FAILED
|
|
|
|
},
|
|
|
|
showProgressSyncSuccess() {
|
|
|
|
this.syncStatus = this.$constants.SyncStatus.SUCCESS
|
2021-11-01 21:06:51 -05:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
2022-06-23 19:27:41 -05:00
|
|
|
this.updateScreenSize()
|
2022-07-02 18:29:41 -05:00
|
|
|
if (screen.orientation) {
|
2022-08-22 17:18:46 -05:00
|
|
|
// Not available on ios
|
2022-07-02 18:29:41 -05:00
|
|
|
screen.orientation.addEventListener('change', this.screenOrientationChange)
|
2022-08-22 17:18:46 -05:00
|
|
|
} else {
|
|
|
|
document.addEventListener('orientationchange', this.screenOrientationChange)
|
2022-07-02 18:29:41 -05:00
|
|
|
}
|
2022-08-22 17:18:46 -05:00
|
|
|
window.addEventListener('resize', this.screenOrientationChange)
|
2022-07-04 15:42:59 -05:00
|
|
|
|
|
|
|
this.$eventBus.$on('minimize-player', this.minimizePlayerEvt)
|
2021-11-01 21:06:51 -05:00
|
|
|
document.body.addEventListener('touchstart', this.touchstart)
|
|
|
|
document.body.addEventListener('touchend', this.touchend)
|
2022-05-29 18:13:25 -05:00
|
|
|
document.body.addEventListener('touchmove', this.touchmove)
|
2021-11-01 21:06:51 -05:00
|
|
|
this.$nextTick(this.init)
|
|
|
|
},
|
|
|
|
beforeDestroy() {
|
2022-07-02 18:29:41 -05:00
|
|
|
if (screen.orientation) {
|
2022-08-22 17:18:46 -05:00
|
|
|
// Not available on ios
|
2022-07-02 18:29:41 -05:00
|
|
|
screen.orientation.removeEventListener('change', this.screenOrientationChange)
|
2022-08-22 17:18:46 -05:00
|
|
|
} else {
|
|
|
|
document.removeEventListener('orientationchange', this.screenOrientationChange)
|
2022-07-02 18:29:41 -05:00
|
|
|
}
|
2022-08-22 17:18:46 -05:00
|
|
|
window.removeEventListener('resize', this.screenOrientationChange)
|
2022-06-23 19:27:41 -05:00
|
|
|
|
2022-04-26 16:46:29 -05:00
|
|
|
if (this.playbackSession) {
|
|
|
|
console.log('[AudioPlayer] Before destroy closing playback')
|
|
|
|
this.closePlayback()
|
|
|
|
}
|
|
|
|
|
2022-01-05 19:09:18 -06:00
|
|
|
this.forceCloseDropdownMenu()
|
2022-07-04 15:42:59 -05:00
|
|
|
this.$eventBus.$off('minimize-player', this.minimizePlayerEvt)
|
2021-11-01 21:06:51 -05:00
|
|
|
document.body.removeEventListener('touchstart', this.touchstart)
|
|
|
|
document.body.removeEventListener('touchend', this.touchend)
|
2022-05-29 18:13:25 -05:00
|
|
|
document.body.removeEventListener('touchmove', this.touchmove)
|
2021-11-01 21:06:51 -05:00
|
|
|
|
|
|
|
if (this.onPlayingUpdateListener) this.onPlayingUpdateListener.remove()
|
|
|
|
if (this.onMetadataListener) this.onMetadataListener.remove()
|
2022-04-02 12:12:00 -05:00
|
|
|
if (this.onPlaybackSessionListener) this.onPlaybackSessionListener.remove()
|
|
|
|
if (this.onPlaybackClosedListener) this.onPlaybackClosedListener.remove()
|
2022-04-16 13:36:30 -05:00
|
|
|
if (this.onPlaybackFailedListener) this.onPlaybackFailedListener.remove()
|
2022-07-19 18:50:14 -05:00
|
|
|
if (this.onProgressSyncFailing) this.onProgressSyncFailing.remove()
|
|
|
|
if (this.onProgressSyncSuccess) this.onProgressSyncSuccess.remove()
|
2023-02-06 17:20:39 -06:00
|
|
|
if (this.onPlaybackSpeedChangedListener) this.onPlaybackSpeedChangedListener.remove()
|
2021-11-01 21:06:51 -05:00
|
|
|
clearInterval(this.playInterval)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
2022-06-23 19:27:41 -05:00
|
|
|
:root {
|
|
|
|
--cover-image-width: 0px;
|
|
|
|
--cover-image-height: 0px;
|
2022-12-04 09:19:50 -06:00
|
|
|
--cover-image-width-collapsed: 46px;
|
|
|
|
--cover-image-height-collapsed: 46px;
|
2023-03-04 16:26:37 -06:00
|
|
|
--title-author-left-offset-collapsed: 80px;
|
2022-06-23 19:27:41 -05:00
|
|
|
}
|
2023-01-11 17:02:18 -06:00
|
|
|
|
2022-05-13 09:28:43 -05:00
|
|
|
.playerContainer {
|
2023-01-31 15:30:13 -06:00
|
|
|
height: 120px;
|
2021-11-01 21:06:51 -05:00
|
|
|
}
|
2022-05-13 09:28:43 -05:00
|
|
|
.fullscreen .playerContainer {
|
2021-11-01 21:06:51 -05:00
|
|
|
height: 200px;
|
|
|
|
}
|
2022-05-13 09:28:43 -05:00
|
|
|
#playerContent {
|
|
|
|
box-shadow: 0px -8px 8px #11111155;
|
|
|
|
}
|
2023-01-11 17:02:18 -06:00
|
|
|
.fullscreen #playerContent {
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
2021-11-01 21:06:51 -05:00
|
|
|
|
|
|
|
#playerTrack {
|
|
|
|
transition: all 0.15s cubic-bezier(0.39, 0.575, 0.565, 1);
|
|
|
|
transition-property: margin;
|
2023-01-31 15:30:13 -06:00
|
|
|
bottom: 35px;
|
2021-11-01 21:06:51 -05:00
|
|
|
}
|
|
|
|
.fullscreen #playerTrack {
|
2023-01-08 14:31:37 -06:00
|
|
|
bottom: unset;
|
2021-11-01 21:06:51 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
.cover-wrapper {
|
2023-01-31 15:30:13 -06:00
|
|
|
bottom: 68px;
|
2023-03-04 16:26:37 -06:00
|
|
|
left: 24px;
|
2022-06-23 19:27:41 -05:00
|
|
|
height: var(--cover-image-height-collapsed);
|
|
|
|
width: var(--cover-image-width-collapsed);
|
2021-11-01 21:06:51 -05:00
|
|
|
transition: all 0.25s cubic-bezier(0.39, 0.575, 0.565, 1);
|
|
|
|
transition-property: left, bottom, width, height;
|
|
|
|
transform-origin: left bottom;
|
2023-03-04 13:59:37 -06:00
|
|
|
border-radius: 3px;
|
|
|
|
overflow: hidden;
|
2021-11-01 21:06:51 -05:00
|
|
|
}
|
|
|
|
|
2021-12-11 13:20:20 -06:00
|
|
|
.total-track {
|
|
|
|
bottom: 215px;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
}
|
|
|
|
|
2021-11-01 21:06:51 -05:00
|
|
|
.title-author-texts {
|
|
|
|
transition: all 0.15s cubic-bezier(0.39, 0.575, 0.565, 1);
|
|
|
|
transition-property: left, bottom, width, height;
|
|
|
|
transform-origin: left bottom;
|
|
|
|
|
|
|
|
width: 40%;
|
2023-01-31 15:30:13 -06:00
|
|
|
bottom: 76px;
|
2023-01-08 13:50:18 -06:00
|
|
|
left: var(--title-author-left-offset-collapsed);
|
2021-11-01 21:06:51 -05:00
|
|
|
text-align: left;
|
|
|
|
}
|
|
|
|
.title-author-texts .title-text {
|
|
|
|
transition: all 0.15s cubic-bezier(0.39, 0.575, 0.565, 1);
|
|
|
|
transition-property: font-size;
|
|
|
|
font-size: 0.85rem;
|
|
|
|
line-height: 1.5;
|
|
|
|
}
|
|
|
|
.title-author-texts .author-text {
|
|
|
|
transition: all 0.15s cubic-bezier(0.39, 0.575, 0.565, 1);
|
|
|
|
transition-property: font-size;
|
|
|
|
font-size: 0.75rem;
|
|
|
|
line-height: 1.2;
|
|
|
|
}
|
|
|
|
|
|
|
|
.fullscreen .title-author-texts {
|
2022-06-23 19:27:41 -05:00
|
|
|
bottom: calc(50% - var(--cover-image-height) / 2 + 50px);
|
2021-11-01 21:06:51 -05:00
|
|
|
width: 80%;
|
|
|
|
left: 10%;
|
|
|
|
text-align: center;
|
2022-06-23 19:27:41 -05:00
|
|
|
padding-bottom: calc(((260px - var(--cover-image-height)) / 260) * 40);
|
2022-07-02 15:40:37 -05:00
|
|
|
pointer-events: auto;
|
2021-11-01 21:06:51 -05:00
|
|
|
}
|
|
|
|
.fullscreen .title-author-texts .title-text {
|
2023-03-04 13:49:58 -06:00
|
|
|
font-size: clamp(0.8rem, calc(var(--cover-image-height) / 260 * 20), 1.3rem);
|
2021-11-01 21:06:51 -05:00
|
|
|
}
|
|
|
|
.fullscreen .title-author-texts .author-text {
|
2023-03-04 13:49:58 -06:00
|
|
|
font-size: clamp(0.6rem, calc(var(--cover-image-height) / 260 * 16), 1rem);
|
2021-11-01 21:06:51 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#playerControls {
|
|
|
|
transition: all 0.15s cubic-bezier(0.39, 0.575, 0.565, 1);
|
|
|
|
transition-property: width, bottom;
|
2023-03-04 16:26:37 -06:00
|
|
|
width: 128px;
|
|
|
|
padding-right: 24px;
|
2023-01-31 15:30:13 -06:00
|
|
|
bottom: 70px;
|
2021-11-01 21:06:51 -05:00
|
|
|
}
|
|
|
|
#playerControls .jump-icon {
|
|
|
|
transition: all 0.15s cubic-bezier(0.39, 0.575, 0.565, 1);
|
|
|
|
transition-property: font-size;
|
|
|
|
|
|
|
|
margin: 0px 0px;
|
|
|
|
font-size: 1.6rem;
|
|
|
|
}
|
|
|
|
#playerControls .play-btn {
|
|
|
|
transition: all 0.15s cubic-bezier(0.39, 0.575, 0.565, 1);
|
2021-11-02 19:44:42 -05:00
|
|
|
transition-property: padding, margin, height, width, min-width, min-height;
|
2021-11-01 21:06:51 -05:00
|
|
|
|
2021-11-02 19:44:42 -05:00
|
|
|
height: 40px;
|
|
|
|
width: 40px;
|
|
|
|
min-width: 40px;
|
|
|
|
min-height: 40px;
|
2023-03-04 16:26:37 -06:00
|
|
|
margin: 0px 7px;
|
2021-11-01 21:06:51 -05:00
|
|
|
}
|
|
|
|
#playerControls .play-btn .material-icons {
|
|
|
|
transition: all 0.15s cubic-bezier(0.39, 0.575, 0.565, 1);
|
|
|
|
transition-property: font-size;
|
|
|
|
|
|
|
|
font-size: 1.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.fullscreen .cover-wrapper {
|
|
|
|
margin: 0 auto;
|
2022-06-23 19:27:41 -05:00
|
|
|
height: var(--cover-image-height);
|
|
|
|
width: var(--cover-image-width);
|
|
|
|
left: calc(50% - (calc(var(--cover-image-width)) / 2));
|
|
|
|
bottom: calc(50% + 120px - (calc(var(--cover-image-height)) / 2));
|
2023-03-04 13:59:37 -06:00
|
|
|
border-radius: 16px;
|
|
|
|
overflow: hidden;
|
2021-12-05 18:31:47 -06:00
|
|
|
}
|
|
|
|
|
2021-11-01 21:06:51 -05:00
|
|
|
.fullscreen #playerControls {
|
|
|
|
width: 100%;
|
2023-03-04 13:49:58 -06:00
|
|
|
padding-left: 24px;
|
|
|
|
padding-right: 24px;
|
|
|
|
bottom: 78px;
|
2023-03-04 16:42:06 -06:00
|
|
|
left: 0;
|
2021-11-01 21:06:51 -05:00
|
|
|
}
|
|
|
|
.fullscreen #playerControls .jump-icon {
|
|
|
|
font-size: 2.4rem;
|
|
|
|
}
|
|
|
|
.fullscreen #playerControls .next-icon {
|
|
|
|
font-size: 2rem;
|
|
|
|
}
|
|
|
|
.fullscreen #playerControls .play-btn {
|
2021-11-02 19:44:42 -05:00
|
|
|
height: 65px;
|
|
|
|
width: 65px;
|
|
|
|
min-width: 65px;
|
|
|
|
min-height: 65px;
|
2021-11-01 21:06:51 -05:00
|
|
|
}
|
|
|
|
.fullscreen #playerControls .play-btn .material-icons {
|
|
|
|
font-size: 2.1rem;
|
|
|
|
}
|
2022-12-08 00:28:28 -05:00
|
|
|
</style>
|