MCPcopy Index your code
hub / github.com/code100x/cms / changeVideoQuality

Function changeVideoQuality

src/components/QualitySelectorControllBar.ts:3–9  ·  view source on GitHub ↗
(quality: string, player: any)

Source from the content-addressed store, hash-verified

1import videojs from 'video.js';
2
3const changeVideoQuality = (quality: string, player: any) => {
4 const currentUrl = new URL(window.location.href);
5 currentUrl.searchParams.set('quality', quality);
6 const newUrl = `${currentUrl.pathname}?${currentUrl.searchParams.toString()}`;
7 window.history.pushState({ path: newUrl }, '', newUrl);
8 player.qualitySelector(quality);
9};
10
11class QualitySelectorControllBar extends videojs.getComponent('Button') {
12 constructor(player: any, options?: any) {

Callers 1

constructorMethod · 0.85

Calls 1

setMethod · 0.65

Tested by

no test coverage detected