kmoskwiak / videojs-resolution-switcher

Resolution switcher adds the ability to select the video quality in video.js player.
https://kmoskwiak.github.io/videojs-resolution-switcher/
Other
402 stars 244 forks source link

Fixed "Setup sources dynamically" #119

Closed boydaihungst closed 6 years ago

boydaihungst commented 6 years ago

i fixed the "player.updateSrc is not a funtion " problem

var player = videojs('video', {
                controls: true,
                plugins: {
                    videoJsResolutionSwitcher: {
                        default: 'high',
                        dynamicLabel: true
                    }
                }
            });
//
           player.updateSrc([
                {
                    src: 'https://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_30mb.mp4',
                    type: 'video/mp4',
                    label: '720'
                },
                {
                    src: 'https://www.sample-videos.com/video/mp4/480/big_buck_bunny_480p_30mb.mp4',
                    type: 'video/mp4',
                    label: '480'
                }
            ]);