About html video tag sources

Asked 1 years ago, Updated 1 years ago, 355 views

When html is written as shown below, which source (url, file path) is the video?

<video class="gifVideo js-gifVideo lazyVideo" 
    data-webm="https://el.phncdn.com/pics/gifs/042/100/151/42100151a.webm"
    data-mp4 = "
"    poster="data:image/gif;base64,R0lGODlhAQABAAAAAAAAAAP//yH5BAEAAAAAAAAAAAAAAAAAAAAAAAA 7" data-poster="https://el.phncdn.com/pics/gifs/042/100/151/(m=bKOCwLV)(mh=LC91wp1cr3v8n- Nk)42100151a.jpg "loop muted> <source class="js-webm" type="video/webm"> <source class="js-mp4" type="video/mp4"> </video>

html

2022-12-08 19:37

2 Answers

data attribute starting with data-, data-mp4, and so on, assuming is accessed from JavaScript (or CSS).

Therefore, it is expected that https://el.phncdn.com/pics/gifs/042/100/151/42100151a.webm or

is the source, but JS needs to see which one is actually the source.
JS is likely to decide which source to adopt under some conditions and set it to src.


2022-12-08 22:25

There's nothing I can say with confidence just by that information.

    You may be using the
  • data-webm or data-mp4 attribute values in your JavaScript code.
  • You may have set JavaScript code from other data.


2022-12-08 22:57

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.