feat(player/playbackRate): set rate with url param

pull/5502/head
kontrollanten 2022-12-28 20:59:02 +01:00 committed by Chocobozzz
parent 1f3198444f
commit 0e08a5e749
3 changed files with 8 additions and 0 deletions

View File

@ -295,6 +295,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
subtitle: queryParams.subtitle, subtitle: queryParams.subtitle,
playerMode: queryParams.mode, playerMode: queryParams.mode,
playbackRate: queryParams.playbackRate,
peertubeLink: false peertubeLink: false
} }
@ -657,6 +658,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
muted: urlOptions.muted, muted: urlOptions.muted,
loop: urlOptions.loop, loop: urlOptions.loop,
subtitle: urlOptions.subtitle, subtitle: urlOptions.subtitle,
playbackRate: urlOptions.playbackRate,
peertubeLink: urlOptions.peertubeLink, peertubeLink: urlOptions.peertubeLink,

View File

@ -97,6 +97,10 @@ export class PeertubePlayerManager {
videojs(options.common.playerElement, videojsOptions, function (this: videojs.Player) { videojs(options.common.playerElement, videojsOptions, function (this: videojs.Player) {
const player = this const player = this
if (!isNaN(+options.common.playbackRate)) {
player.playbackRate(+options.common.playbackRate)
}
let alreadyFallback = false let alreadyFallback = false
const handleError = () => { const handleError = () => {

View File

@ -29,6 +29,8 @@ export interface CustomizationOptions {
resume?: string resume?: string
peertubeLink: boolean peertubeLink: boolean
playbackRate: number | string
} }
export interface CommonOptions extends CustomizationOptions { export interface CommonOptions extends CustomizationOptions {