Reputation: 284
in a page i have added a video.js html5 player. in a function i am doing this:
var myPlayer = document.getElementById("example_video_1");
myPlayer.pause();
and it works. But when i try to do something like:
myPlayer.currentTime(30);
it doesn't work. even though this works:
alert(myPlayer.currentTime);
i don't understand why the play() and pause() functions work and i can get some information about the status of the player, but i cant use any other functions from the video-js API.
i know i should be getting the video item like this:
var myPlayer = _V_("example_video_1");
but if i do it that way i get: V is not defined in the console. any ideas?
Upvotes: 0
Views: 6305
Reputation: 3072
Sounds like you're using an older js call to the code, there's a cross over to a newer version. Since you don't state which version you're using it's difficult to analyse. Try replacing:
_V_
with
videojs
**Update: Use 'vjs'; if you upgrade or have started using version 4.4.3, it explains in the dev code...
*
* **ALIASES** videojs, _V_ (deprecated)
*
* The `vjs` function can be used to initialize or retrieve a player.
*
Upvotes: 1