Why some video elements don't have src attribute?

After digging quite deep in the DOM tree of a website I came accross a video element like this:

<video class="top-player-video-element" poster="//cdn.SOMEWEBSITE.com/dir_1/dir_2/dir_3/filename.jpg"></video>

I was surprised not to find an src attribute that can be found on image files in the DOM.

Why some video elements in a DOM don’t have src?
What makes videos any different than image files that do have src attributes?

This is how I code videos…

<video controls poster="someimage.jpg">
 <source src="somevideo.mp4" type="video/mp4">
</video>
2 Likes

Maybe the src attribute is being added by JS.

2 Likes

In a few sporadic cases I have added HTML to the DOM by JavaScript, or this may be a case when something is added by JavaScript but without appearing at the DOM?

a

Perhaps I shouldn’t say this but the </video> closer is on the same line.

:expressionless:

Each time I clicked on the “Play” or “Replay” button (but not pause-play button combo), I got a new result in the DOM:

src="blob:https://edition.example.com/2a50dbb4-fee9-48a7-ae8b-f72b579169b0"

then:

src="blob:https://edition.example.com/d670d1e0-fc84-4029-82d8-552bb9d7b694"

I tried to access each, without blob: and with blob:
Without blob: I got something like “Uh-Ha It’s us or you but the file cannot be found”
With blob: I got ERR_FILE_NOT_FOUND

What may cause this behvaior?

To appear in the DOM it would need to be coded correctly…

HTML

 <video class="top-player-video-element"></video> 

JavaScript

<script>
(function( d ) {
   d.querySelector('.top-player-video-element').setAttribute('controls','controls'),
   d.querySelector('.top-player-video-element').setAttribute('poster','https://i.postimg.cc/Qd1zGKFv/poster.jpg'),
   d.querySelector('.top-player-video-element').setAttribute('src','http://techslides.com/demos/sample-videos/small.mp4'),
   d.querySelector('.top-player-video-element').setAttribute('type','video/mp4');
}( document ));
</script>

The fundamental cause is that they do not want people downloading their videos. Look at YouTube videos, they are all BLObs. Many sites use BLObs to make their videos difficult to use when we download them. Any difficulty you have accessing the videos is intentional and they want to make it as difficult as possible. There are developers that make money by providing a service that make such downloads possible.

I only have cursory knowledge of this but a Blob is Binary Large OBject.

It is a way of handling large files by manipulating chunks of raw data so that it is more efficient.

Indeed.

Though, I understand that in principle, with enough code of the relevant language/s it will always be possible to bypass this.

JavaScript, AutoHotkey? Some combo.

In the worst case, one can fix a tripod in front of a computer screen and just record the screen with the video played on full screen mode, then edit the record in some video editing software if needed.

I guess since the site has gone to lengths to hide the locations of the videos, it would be against their terms of service to attempt to bypass their security. That being the case we will not help you to do so.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.