background-color: transparent !important;
}
+ &.vjs-has-started .vjs-big-play-button {
+ display: block;
+ visibility: hidden;
+ opacity: 0;
+ transition: visibility 0.5s, opacity 0.5s;
+ }
+
+ .vjs-loading-spinner {
+ display: block;
+ visibility: hidden;
+ opacity: 0;
+ }
+
+ &.vjs-waiting .vjs-loading-spinner {
+ visibility: visible;
+ opacity: 1;
+ transition: visibility 0.5s, opacity 0.5s;
+ }
+
.vjs-control-bar,
.vjs-big-play-button,
.vjs-menu-button .vjs-menu-content {
}
@media screen and (max-width: 550px) {
+ .vjs-big-play-button {
+ font-size: 6.5em;
+ }
+
.vjs-webtorrent {
padding: 0 !important;
}
@media screen and (max-width: 300px) {
+ .vjs-dock-text {
+ font-size: 1.5em;
+ }
+
+ .vjs-big-play-button {
+ font-size: 5em;
+ }
+
.vjs-volume-control {
display: none !important;
}
})
}
- getPreviewPath (key: string) {
+ async getPreviewPath (key: string) {
+ const video = await VideoModel.loadByUUID(key)
+ if (!video) return undefined
+
+ if (video.isOwned()) return join(CONFIG.STORAGE.PREVIEWS_DIR, video.getPreviewName())
+
return new Promise<string>((res, rej) => {
this.lru.get(key, (err, value) => {
err ? rej(err) : res(value)
}
private async loadPreviews (key: string) {
- const video = await VideoModel.loadByUUIDAndPopulateAccountAndServerAndTags(key)
+ const video = await VideoModel.loadByUUID(key)
if (!video) return undefined
- if (video.isOwned()) return join(CONFIG.STORAGE.PREVIEWS_DIR, video.getPreviewName())
+ if (video.isOwned()) throw new Error('Cannot load preview of owned video.')
const res = await this.saveRemotePreviewAndReturnPath(video)
.findById(id, options)
}
+ static loadByUUID (uuid: string) {
+ const options = {
+ where: {
+ uuid
+ }
+ }
+
+ return VideoModel
+ .scope([ ScopeNames.WITH_FILES ])
+ .findOne(options)
+ }
+
static loadByUUIDAndPopulateAccountAndServerAndTags (uuid: string) {
const options = {
order: [ [ 'Tags', 'name', 'ASC' ] ],