<div dir="ltr">LibreOffice Developers<br><br>This my first time posting so please direct me to the most appropiate list<br><br>Pls can someone tell me how to take the code from firefox that handles video and audio media and insert it into Libreoffice? Someone did suggest that in 2011 but I do not know if that was done.<br><br>Or get Firefox to access a Libreoffice file directly.<br><br>Firefox can play videos and media with a progress bar etc - there is also a vlc extension for firefox.<br><br>While Lireoffice has good ideas and features eg everything in a single file and toc.<br><br>Due to the scale of my project the subdocuments are generated using perl. Most of what is required is done or acheivable except for the video / audio media section.<br><br>A html version can already be generated but it produces lots of picture and media files.<br><br>How do you put video and audio in a odt file? After all it is another draw:frame just like an image or text box.<br><br>In the impress route you have to add autostart and still there is no autostop or pause bar.<br><br>In openoffice::oodoc::text you can add in an image as well as text.<br><br>Is there a way using openoffice::oodoc::xpath to simply generate the xml code required. This technique is already being used in my project to add in images, text boxes, toc etc.<br><br>For example<br><br>#!/usr/bin/perl<br>use strict;<br>use warnings;<br>use utf8;<br>use OpenOffice::OODoc;<br>use OpenOffice::OODoc::XPath;<br><br># open the document container<br>my $cont = odfContainer("/path/to/ExistingTemplateFile.odt");<br><br># set up the doc variable<br>my $doc = odfDocument(<br>    "container" => $cont,<br>    "part" => 'content');<br><br># set up song file and member parameters<br>my $song = "MySong.webm";<br>my $songfile = "/path/to/".$song;<br>my $member = "Media/".$song;<br>my $wdth = 640;<br>my $hght = 400;<br>my $gx = 0;<br>my $gy = 0;<br><br># see reference manual on command line with man or via google from CPAN<br># man openoffice::oodoc::xpath<br><br>$doc->appendBodyElement( $doc->createElement (<br>'<draw:frame draw:layer="layout" '.<br>'draw:style-name="standard" '.<br>'svg:height="'.&frmtcm(&px2cm($hght)).'cm" '.<br>'svg:width="'.&frmtcm(&px2cm($wdth)).'cm" '.<br>'svg:x="'.&frmtcm(&px2cm($gx)).'cm" '.<br>'svg:y="'.&frmtcm(&px2cm($gy).'cm"><br><draw:plugin '.<br>'draw:mime-type="application/vnd.sun.star.media" '.<br>'xlink:actuate="onLoad" '.<br>'xlink:href="'.$member.'" '.<br>'xlink:show="embed" '.<br>'xlink:type="simple"><br><draw:param draw:name="Loop" draw:value="false"/><br><draw:param draw:name="Mute" draw:value="false"/><br><draw:param draw:name="VolumeDB" draw:value="0"/><br></draw:plugin><br></draw:frame><br>'));<br><br># Load the songfile into the Media section of the odt<br>$doc->raw_import($member, $songfile);<br><br># Save The Updated odt<br>$doc->save("/path/to/UpdatedFile.odt");<br><br>sub frmtcm {<br>    my $x = shift;<br>    if (defined($x)) {<br>        my $y = sprintf ("%7.3f", $x);<br>        $y =~ s/^ *//g;<br>        return $y;<br>    } else {<br>        return 0;<br>    }<br>}<br>sub px2cm {<br>    return $_[0] * 2.54 / 96;<br>}<br><br>Or as an alternative can Firefox other browser which can handle xml be made to access the video from the odt file and the browser be accessed using imbeded html object. This html works fine on a stand alone video src file but does not extract the song from an odt yet. How to fix this?<br><br><html><br><head><br><title>MySong Video</title><br></head><br><body><br> <video width="640" height="400" controls="1"><br>  <source src="file:///path/to/my.odt#Media/MySong.webm" type="video/webm"><br>Your browser does not support the video tag.<br></video> <br></body><br></html><br><br>Thank you for your attention to my question.<br><br>Regards<br>Philip<br><br>My Lenova laptop runs Fedora 33</div>