Page 1 of 1

Disable autoplay in embedded videos

Posted: Tue Aug 18, 2020 12:46 am
by cwilki
I'm trying to embed several mp4 videos in my DITA project, but when the HTML5 is generated, the videos all autoplay in both Chrome & IE/Edge. (This doesn't seem to occur in Firefox, FWIW.)

The code I'm using in my .dita topic file is:

Code: Select all

<object outputclass="video" type="video/mp4" data="link-to-video-file-here.mp4" width="640" height="360">
<param name="autoplay" value="false" />
<param name="allowFullScreen" value="true" />
<param name="controls" value="yes"/>
</object>
Is there some other parameter I should be using that can disable autoplay on embedded video files?

Re: Disable autoplay in embedded videos

Posted: Tue Aug 18, 2020 7:23 am
by Radu
Hi,

I cannot reproduce this problem on my side. Are you using Oxygen's bundled DITA OT or an external DITA OT distribution for publishing?
I published to HTML5 and used Chrome and Firefox to try this out.
If you look in the HTML output at the HTML page for your topic, how does the generated HTML structure for the DITA <video> look like?

Regards,
Radu

Re: Disable autoplay in embedded videos

Posted: Tue Aug 18, 2020 7:36 pm
by cwilki
We use an external build system to generate our DITA documentation - OxygenXML Editor is used for authoring & editing. The generated HTML page displays the video as:

Code: Select all

<object type="video/mp4" height="360" data="link-to-video-file-here.mp4" width="640">
<param name="autoplay" value="false" valuetype="data"></param>
<param name="allowFullScreen" value="true" valuetype="data"></param>
<param name="controls" value="yes" valuetype="data"></param></object>
Any ideas/suggestions would be much appreciated. Thanks!

Re: Disable autoplay in embedded videos

Posted: Tue Aug 18, 2020 11:42 pm
by cwilki
We use OxygenXML for authoring and editing, but we use an external build system, so that could be where the error is occurring? The HTML for the video once it's rendered is:

Code: Select all

<object type="video/mp4" height="360" data="link-to-video-here.mp4" width="640">
<param name="autoplay" value="false" valuetype="data"></param>
<param name="allowFullScreen" value="true" valuetype="data"></param>
<param name="controls" value="yes" valuetype="data"></param></object>
Any ideas or suggestions would be very helpful. Thanks!

Re: Disable autoplay in embedded videos

Posted: Wed Aug 19, 2020 7:22 am
by Radu
Hi,

You need to install this extra free plugin in the DITA Open Toolkit you are using for publishing:
https://github.com/oxygenxml/dita-media-support
It will generate modern HTML <video> and <iframe> elements from your DITA objects.

Regards,
Radu

Re: Disable autoplay in embedded videos

Posted: Wed Sep 16, 2020 5:26 pm
by jcadel
I am experiencing the same issue. I downloaded the plug-in but that has not resolved the problem. How do I disable auto-play for embedded videos?

Re: Disable autoplay in embedded videos

Posted: Wed Sep 16, 2020 6:04 pm
by Radu
Hi,

Have you integrated the plugin after copying it to your DITA OT plugins folder? How does the generated HTML output look like? Does it contain <video> elements for each DITA <object> element? Do you specify those @outputclass attribute values on the DITA object elements like exemplified here?
https://www.oxygenxml.com/doc/versions/ ... ideos.html


Regards,
Radu

Re: Disable autoplay in embedded videos

Posted: Thu Sep 17, 2020 4:32 pm
by jcadel
Hi Radu,

Yes, I integrated the plugin and copied it to the DITA OT plugins folder. It was integrated successfully.

The generated output looks like this:
<iframe frameborder="0" height="468" src="https://videoURL " width="640"></iframe>

This is what the code looks like in Oxygen:
<object width="640" outputclass="iframe" height="468"
data="https://www.iceportal.com/brochures/Med ... e3d99a38f8"

Re: Disable autoplay in embedded videos

Posted: Fri Sep 18, 2020 12:10 pm
by Radu
Hi,

An HTML <iframe> displays an entire HTML page in there. In your case the page has a video inside but to my knowledge you cannot force the iframe to not start a certain video in the displayed HTML content. You can try to edit directly that HTML output and see if you can find any way to avoid playing that video. In my opinion this would be possible only if that certain web site to which you send GET parameters in the URL query would have a separate URL query like "autoplay=no" which it could interpret on its side. But you would need to discuss this with the web site's owners.
This discussion thread initially discussed producing HTML <video> elements which indeed have parameters which can disable auto play (actually auto play is disabled for videos by default). But these video elements point to video files, not to web sites which contain videos inside them.

Regards,
Radu