From 8953f055c86ca74f145d7ac5ac93bb6104d73af9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 10 Jul 2023 16:08:53 +0200 Subject: [PATCH] Rename player embed api --- .../src/standalone/{player => embed-player-api}/.npmignore | 0 client/src/standalone/{player => embed-player-api}/README.md | 0 .../standalone/{player => embed-player-api}/definitions.ts | 0 client/src/standalone/{player => embed-player-api}/events.ts | 0 .../src/standalone/{player => embed-player-api}/package.json | 0 client/src/standalone/{player => embed-player-api}/player.ts | 0 .../standalone/{player => embed-player-api}/tsconfig.json | 0 .../{player => embed-player-api}/webpack.config.js | 0 client/src/standalone/videos/embed-api.ts | 2 +- client/src/standalone/videos/embed.ts | 5 ++++- client/src/standalone/videos/test-embed.ts | 4 ++-- 11 files changed, 7 insertions(+), 4 deletions(-) rename client/src/standalone/{player => embed-player-api}/.npmignore (100%) rename client/src/standalone/{player => embed-player-api}/README.md (100%) rename client/src/standalone/{player => embed-player-api}/definitions.ts (100%) rename client/src/standalone/{player => embed-player-api}/events.ts (100%) rename client/src/standalone/{player => embed-player-api}/package.json (100%) rename client/src/standalone/{player => embed-player-api}/player.ts (100%) rename client/src/standalone/{player => embed-player-api}/tsconfig.json (100%) rename client/src/standalone/{player => embed-player-api}/webpack.config.js (100%) diff --git a/client/src/standalone/player/.npmignore b/client/src/standalone/embed-player-api/.npmignore similarity index 100% rename from client/src/standalone/player/.npmignore rename to client/src/standalone/embed-player-api/.npmignore diff --git a/client/src/standalone/player/README.md b/client/src/standalone/embed-player-api/README.md similarity index 100% rename from client/src/standalone/player/README.md rename to client/src/standalone/embed-player-api/README.md diff --git a/client/src/standalone/player/definitions.ts b/client/src/standalone/embed-player-api/definitions.ts similarity index 100% rename from client/src/standalone/player/definitions.ts rename to client/src/standalone/embed-player-api/definitions.ts diff --git a/client/src/standalone/player/events.ts b/client/src/standalone/embed-player-api/events.ts similarity index 100% rename from client/src/standalone/player/events.ts rename to client/src/standalone/embed-player-api/events.ts diff --git a/client/src/standalone/player/package.json b/client/src/standalone/embed-player-api/package.json similarity index 100% rename from client/src/standalone/player/package.json rename to client/src/standalone/embed-player-api/package.json diff --git a/client/src/standalone/player/player.ts b/client/src/standalone/embed-player-api/player.ts similarity index 100% rename from client/src/standalone/player/player.ts rename to client/src/standalone/embed-player-api/player.ts diff --git a/client/src/standalone/player/tsconfig.json b/client/src/standalone/embed-player-api/tsconfig.json similarity index 100% rename from client/src/standalone/player/tsconfig.json rename to client/src/standalone/embed-player-api/tsconfig.json diff --git a/client/src/standalone/player/webpack.config.js b/client/src/standalone/embed-player-api/webpack.config.js similarity index 100% rename from client/src/standalone/player/webpack.config.js rename to client/src/standalone/embed-player-api/webpack.config.js diff --git a/client/src/standalone/videos/embed-api.ts b/client/src/standalone/videos/embed-api.ts index cdda122b2..6227c378e 100644 --- a/client/src/standalone/videos/embed-api.ts +++ b/client/src/standalone/videos/embed-api.ts @@ -1,7 +1,7 @@ import './embed.scss' import * as Channel from 'jschannel' import { logger } from '../../root-helpers' -import { PeerTubeResolution, PeerTubeTextTrack } from '../player/definitions' +import { PeerTubeResolution, PeerTubeTextTrack } from '../embed-player-api/definitions' import { PeerTubeEmbed } from './embed' /** diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts index 5c68aaaf2..78b812ffd 100644 --- a/client/src/standalone/videos/embed.ts +++ b/client/src/standalone/videos/embed.ts @@ -242,7 +242,10 @@ export class PeerTubeEmbed { this.buildPlayerIfNeeded() ]) - this.peertubePlayer.setPoster(window.location.origin + video.previewPath) + // If already played, we are in a playlist so we don't want to display the poster between videos + if (!this.alreadyPlayed) { + this.peertubePlayer.setPoster(window.location.origin + video.previewPath) + } const playlist = this.playlistTracker ? { diff --git a/client/src/standalone/videos/test-embed.ts b/client/src/standalone/videos/test-embed.ts index b34df11ee..b7a283c4d 100644 --- a/client/src/standalone/videos/test-embed.ts +++ b/client/src/standalone/videos/test-embed.ts @@ -1,6 +1,6 @@ import './test-embed.scss' -import { PeerTubeResolution, PlayerEventType } from '../player/definitions' -import { PeerTubePlayer } from '../player/player' +import { PeerTubeResolution, PlayerEventType } from '../embed-player-api/definitions' +import { PeerTubePlayer } from '../embed-player-api/player' import { logger } from '../../root-helpers' window.addEventListener('load', async () => {