Jump to content

How to limit replays on html5 <video> player


Chrisj

Recommended Posts

The html5 player works successfully on my web page, but I’m wondering if there is a way to limit the video replays. Here’s the code:

<video id="my-video1" controls autoplay style="width:100%; height:100%;" poster="{{THUMBNAIL}}" disablePictureInPicture controlsList="nodownload"> <?php if (!empty($pt->video_1080)) { ?> <source src="{{VIDEO_LOCATION_1080}}" type="{{VIDEO_TYPE}}" data-quality="1080p"> <?php } ?> <?php if (!empty($pt->video_720)) { ?> <source src="{{VIDEO_LOCATION_720}}" type="{{VIDEO_TYPE}}" data-quality="720p"> <?php } ?> <?php if (!empty($pt->video_480)) { ?> <source src="{{VIDEO_LOCATION_480}}" type="{{VIDEO_TYPE}}" data-quality="480p"> <?php } ?> <?php if (!empty($pt->video_360)) { ?> <source src="{{VIDEO_LOCATION_360}}" type="{{VIDEO_TYPE}}" data-quality="360p"> <?php } ?> <?php if (!empty($pt->video_240)) { ?> <source src="{{VIDEO_LOCATION_240}}" type="{{VIDEO_TYPE}}" data-quality="240p"> <?php } ?> Your browser does not support HTML5 video. </video>

 

I look forward to any replies/assistance

 

Link to comment
Share on other sites

You can't prevent someone from replaying the video if it downloaded to their computer. Most you can do is prevent them from downloading the video a second time, which you would do by creating a one-time URL that allows you to know when the video was requested and when another attempt to download through that same URL should be blocked (which implies routing the video through a PHP script instead of giving direct access).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.