Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

player.watermark is not a function #14

Open
bansalvedant opened this issue Sep 13, 2018 · 0 comments
Open

player.watermark is not a function #14

bansalvedant opened this issue Sep 13, 2018 · 0 comments

Comments

@bansalvedant
Copy link

bansalvedant commented Sep 13, 2018

I am trying to use the videojs-watermark npm module but the error which I am getting is - TypeError: player.watermark is not a function.

The code is as follows -

import React, { Component } from 'react';
import videojs from 'video.js';
import 'videojs-watermark';

class App extends Component {
componentDidMount(){
const player = videojs('my-player');
player.watermark({
file: 'watermark.png',
xpos: 50,
ypos: 50,
xrepeat: 0,
opacity: 0.5,
})
}

render() {
return (


<video
id="my-player"
class="video-js"
controls
preload="auto"
poster="//vjs.zencdn.net/v/oceans.png"
data-setup='{}'

  <source src="//vjs.zencdn.net/v/oceans.mp4" type="video/mp4"></source>
  <source src="//vjs.zencdn.net/v/oceans.webm" type="video/webm"></source>
  <source src="//vjs.zencdn.net/v/oceans.ogv" type="video/ogg"></source>
  <p class="vjs-no-js">
    To view this video please enable JavaScript, and consider upgrading to a
    web browser that
    <a href="http://videojs.com/html5-video-support/" target="_blank">
      supports HTML5 video
    </a>
  </p>
</video>
<script>
  
</script>
  </div>
);

}
}

export default App;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant