File tree Expand file tree Collapse file tree 2 files changed +1037
-2
lines changed
Expand file tree Collapse file tree 2 files changed +1037
-2
lines changed Original file line number Diff line number Diff line change 11/*! (C) The Hyperaudio Project. MIT @license: en.wikipedia.org/wiki/MIT_License. */
2- /*! Version 2.0.19 */
2+ /*! Version 2.0.20 */
33
44'use strict' ;
55
@@ -53,9 +53,32 @@ function soundcloudPlayer(instance) {
5353 }
5454}
5555
56- function vimeoPlayer ( instance ) {
56+ function videojsPlayer ( instance ) {
5757 const tag = document . createElement ( 'script' ) ;
5858
59+ this . player = videojs . getPlayer ( instance . player . id ) ;
60+
61+ this . getTime = ( ) => {
62+ return new Promise ( ( resolve ) => {
63+ resolve ( this . player . currentTime ( ) ) ;
64+ } ) ;
65+ }
66+
67+ this . setTime = ( seconds ) => {
68+ this . player . currentTime ( seconds ) ;
69+ }
70+
71+ this . play = ( ) => {
72+ this . player . play ( ) ;
73+ }
74+
75+ this . pause = ( ) => {
76+ this . player . pause ( ) ;
77+ }
78+ }
79+
80+ function vimeoPlayer ( instance ) {
81+ const tag = document . createElement ( 'script' ) ;
5982
6083 const iframe = document . querySelector ( 'iframe' ) ;
6184 this . player = new Vimeo . Player ( iframe ) ;
@@ -135,6 +158,7 @@ const hyperaudioPlayerOptions = {
135158 "native" : nativePlayer ,
136159 "soundcloud" : soundcloudPlayer ,
137160 "youtube" : youtubePlayer ,
161+ "videojs" : videojsPlayer ,
138162 "vimeo" : vimeoPlayer
139163}
140164
You can’t perform that action at this time.
0 commit comments