Check if request is coming from a <video> tag

Hi there!
I was wondering if when a <video> tag retrieves a video from a URL if it contains anything in the request that could identify it as a <video> tag or not as a user.


You might be able to use the user agent header:

Note: I have not tested this, but I think it should come up as a bot? Maybe?
1 Like

I’ll have a look :slight_smile:

1 Like

You could try this:

var video = document.getElementById("videotag");
video.onloadeddata = function() {
    // Do Something

I haven’t tried, but maybe you could figure it out from the Accept header.

You can check if the request is coming from another domain using the Origin header I think to prevent hotlinking

This tells me either video or document depending on the request :tada:

1 Like

Works perfectly