Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make embeded videos only available to a specific player

I'm trying to figure out how to make an embedded video only readable by a specific player. Here's the context:

I have a website that hosts videos for streaming. All videos are private. My clients would like to be able to generate an embedding code snippet that would allow him to post this video to whichever site he desires. (ultimately this means that the video stream is no longer private but now made public).

Now this is the tricky part. The client does not want these videos to be scannable via their URLs, meaning that if the video url is http://my.domain.com/videoToken, any bots/users/programs hitting that URL will not see the video, however the player needs to load the video from that same URL.

Anyone know what secure options I have for implementing this? There are some DRM solutions out there, are those of any help for this use case?

Thanks in advance.

PS: if this is not possible for whatever reason, what's the next closest thing?

like image 584
Pomme.Verte Avatar asked Jun 29 '16 13:06

Pomme.Verte


People also ask

How do I allow play embedded YouTube videos on one page?

enablejsapi=1' to the end of the embed URL. Essentially this manager keeps track of the registered videos. If it detects that a registered video begins to play it will pause any other registered video that is currently playing.

How do you embed a YouTube video at a certain time?

To have a video start playing from a specific point, add “? start=” to a video's embed code, followed by the time in seconds at which you'd like the video to begin playing.

Can you embed just part of a YouTube video?

When copying the embed code from YouTube, you can simply deselect “Show recommended videos”. If we want our embeded video to use certain start and/or end times, we'll need to add in another line of code.


1 Answers

What if we put something similar to the following on a .htacces file?

<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{HTTP_REFERER} ^http://(www\.)?my.domain\.com/.*$ [NC]
 RewriteRule .*\.(mp4|avi)$ http://www.my.domain.com/forbidden.mp4 [R,NC,L]
 # or serve a standard 403 forbidden error page
 # RewriteRule .*\.(mp4|avi)$ - [F,L]
</ifModule>

Maybe that's not the solution, but the idea of use mod_rewrite to control access to video on an HTTP_REFERER basis could be developed.

like image 99
ernestortiz Avatar answered Sep 28 '22 03:09

ernestortiz