Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Dec 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions client/src/app/+videos/+video-watch/video-watch.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
subtitle: queryParams.subtitle,

playerMode: queryParams.mode,
playbackRate: queryParams.playbackRate,
peertubeLink: false
}

Expand Down Expand Up @@ -657,6 +658,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
muted: urlOptions.muted,
loop: urlOptions.loop,
subtitle: urlOptions.subtitle,
playbackRate: urlOptions.playbackRate,

peertubeLink: urlOptions.peertubeLink,

Expand Down
4 changes: 4 additions & 0 deletions client/src/assets/player/peertube-player-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ export class PeertubePlayerManager {
videojs(options.common.playerElement, videojsOptions, function (this: videojs.Player) {
const player = this

if (!isNaN(+options.common.playbackRate)) {
player.playbackRate(+options.common.playbackRate)
}

let alreadyFallback = false

const handleError = () => {
Expand Down
2 changes: 2 additions & 0 deletions client/src/assets/player/types/manager-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export interface CustomizationOptions {
resume?: string

peertubeLink: boolean

playbackRate: number | string
}

export interface CommonOptions extends CustomizationOptions {
Expand Down