(quality: string, player: any)
| 1 | import videojs from 'video.js'; |
| 2 | |
| 3 | const 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 | |
| 11 | class QualitySelectorControllBar extends videojs.getComponent('Button') { |
| 12 | constructor(player: any, options?: any) { |