@@ -57,14 +57,11 @@ <h2>Custom Components</h2>
5757 </ div >
5858
5959 < script type ="module ">
60- import { videoPlayer } from 'cloudinary-video-player' ;
61- import 'cloudinary-video-player/playlist' ;
62-
60+ import { videoPlayer , videojs } from 'cloudinary-video-player' ;
6361 import 'cloudinary-video-player/cld-video-player.min.css' ;
6462
6563 // Get the ClickableComponent base class from Video.js
66- let vjs = window . videojs . default || window . videojs ;
67- const ClickableComponent = vjs . getComponent ( 'ClickableComponent' ) ;
64+ const ClickableComponent = videojs . getComponent ( 'ClickableComponent' ) ;
6865
6966 // Create a common class for playlist buttons
7067 class PlaylistButton extends ClickableComponent {
@@ -83,7 +80,7 @@ <h2>Custom Components</h2>
8380
8481 const typeCssClass = 'vjs-playlist-' + type + '-control' ;
8582
86- return vjs . createEl ( 'button' , {
83+ return videojs . createEl ( 'button' , {
8784 // Prefixing classes of elements within a player with "vjs-"
8885 // is a convention used in Video.js.
8986 className : 'vjs-control vjs-playlist-control vjs-button ' + typeCssClass
@@ -119,8 +116,8 @@ <h2>Custom Components</h2>
119116 }
120117
121118 // Register the component with Video.js, so it can be used in players.
122- vjs . registerComponent ( 'NextButton' , NextButton ) ;
123- vjs . registerComponent ( 'PreviousButton' , PreviousButton ) ;
119+ videojs . registerComponent ( 'NextButton' , NextButton ) ;
120+ videojs . registerComponent ( 'PreviousButton' , PreviousButton ) ;
124121
125122 // Cloudinary Video Player related code
126123 // ====================================
0 commit comments