AlbertMunichMar
AlbertMunichMar

Reputation: 1866

HTML object autoplay off

I am using the object tag for displaying documents. PDFs, images and videos. While displaying videos, the autoplay tag is there by default. I have tried to disabled it without success:

Note: I am not using the video tag, but the object tag.

  <object autostart="false" class="document" type="text/html" data='<%= make_https(card.docu.url) %>'>
    <param name="autoplay" value="false">
  </object>

I already tried autostart="0", 0, false. I run out of ideas.

Any help would be appreciated. Otherwise I will have to destroy the attribute with ES6, something that I want to avoid.

Edit: after trying autostart="false" and autoplay="false", still did not work. I am affecting the object tag, not the video tag, who has by default the autoplay:

enter image description here

How can I remove the autoplay in the video tag, if I am using the object tag?

Thanks

Upvotes: 3

Views: 2395

Answers (2)

Ohad Cohen
Ohad Cohen

Reputation: 6152

This post sits here for 3 years with no answer.

I've encountered a similar situation, what I did was to add onload function to pause the videos (works in FF 88 and chromium 90, on ubuntu):

<object class="document" type="text/html" data='<%= make_https(card.docu.url) %>'  onload="this.contentDocument.querySelector('video').pause()">
</object>

Upvotes: 3

user10120770
user10120770

Reputation:

Try to use 1 and 0 value for true or false.

Upvotes: 0

Related Questions