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

how to use this in Next.js #118

Closed BillJC-Liu closed 6 years ago

BillJC-Liu commented 6 years ago

i import this in Next.js , have error:window is not defined.

BillJC-Liu commented 6 years ago

ReferenceError: window is not defined at D:\project\team\管理平台\node_modules\videojs-resolution-switcher\lib\videojs-resolution-switcher.js:11:3 at Object. (D:\project\team\管理平台\node_modules\videojs-resolution-switcher\lib\videojs-resolution-switcher.js:358:3) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object.videojs-resolution-switcher/lib/videojs-resolution-switcher (webpack:/external "videojs-resolution-switcher/lib/videojs-resolution-switcher":1:0) at webpack_require__ (webpack:/webpack/bootstrap 9b3d4a4c995d53a2c1fd:21:0) at Object../components/classRoom_ctrl/classRoom.js (D:\project\team\管理平台.next\dist\bundles\pages\classRoom.js:104:118) at webpack_require (webpack:/webpack/bootstrap 9b3d4a4c995d53a2c1fd:21:0) at Object../pages/classRoom.js (D:\project\team\管理平台.next\dist\bundles\pages\classRoom.js:1455:95) at webpack_require__ (webpack:/webpack/bootstrap 9b3d4a4c995d53a2c1fd:21:0) at Object.3 (D:\project\team\管理平台.next\dist\bundles\pages\classRoom.js:1681:18)