wcarr310 / videojs-watermark

A videojs plugin that adds a watermark to videojs player
Other
50 stars 27 forks source link

player.watermark is not a function #15

Closed bishnupradhan closed 5 years ago

bishnupradhan commented 5 years ago

I am trying to use the videojs-watermark in my player through installing via npm and import the plugin into my typescript and bundle both js via webpack-cli 3.3. video.js: 7.2.10, videojs-watermark: 2.0.0

but the error which I am getting is - TypeError: player.watermark is not a function. Does anybody know what could be wrong or if something is missing in my implementation?

The code snippets as follows:

import videojs from 'video.js';
import 'videojs-watermark';

.......
var player = videojs('my-video');
player.watermark();
player.src({
src: videoUrl,
type: 'video/mp4',
)};
........
brookslyrette commented 5 years ago

@bishnupradhan this plugin doesn't support videojs@7.x. It was designed for 6.x or 5.x.

bishnupradhan commented 5 years ago

@brookslyrette the issue has been fixed. The plugin needs to register with videojs before calling. That's it.

grliao commented 4 years ago

@brookslyrette the issue has been fixed. The plugin needs to register with videojs before calling. That's it.

how to regist the plugin ?