dudeman / videojs-ageGate

presents an age gate that users must pass before videos are playable.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

videojs-ageGate

presents an age gate that users must pass before videos are playable.

USAGE:

<video id="video" src="movie.mp4" controls></video>
<script src="video.js"></script>
<script src="videojs-ageGate.js"></script>
<link href="videojs-ageGate.css" rel="stylesheet">
<script>
  var player = videojs('video');
  var minimumDate = new Date();
  minimumDate.setFullYear(minimumDate.getFullYear() - 18);

  player.ageGate({
    minDate: minimumDate,
    promptMessage: 'Please enter your birth date',
    deniedMessage: 'Sorry, the content creator has limited views of this video to people aged 18 and older'
  });

</script>

TODO:

After failing the age gate, users can get another crack at it by simply reloading that page. That works for our needs, but the plugin should probably be configurable to make retrys harder?

About

presents an age gate that users must pass before videos are playable.

License:Apache License 2.0


Languages

Language:JavaScript 87.8%Language:CSS 12.2%