Skip to content

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

License

Notifications You must be signed in to change notification settings

dudeman/videojs-ageGate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published