Embedding vlc player

5,189 views
Skip to first unread message

FrD

unread,
Feb 2, 2012, 6:54:16 AM2/2/12
to tiddl...@googlegroups.com
Hello,

I'd like to embed a vlc player in a tiddler. The mozilla vlc plugin is installed.
I'd use it to play various files stored on my computer (.avi files)

I tried :
<html>
<embed type="application/x-vlc-plugin"
         autoplay="yes" loop="yes" width="400" height="300"
         id="vlc"
         target="myfile.avi" />
</html>
<script label="play">
var vlc = document.getElementById("vlc");
vlc.playlist.play();
</script>

I only get a black rectangle but no movie playing.

Has anyone succeeded in using vlc this way ?

Thanks in advance

FrD

FrD

unread,
Feb 3, 2012, 9:53:43 AM2/3/12
to tiddl...@googlegroups.com
Hi,

I'm dropping the vlc player and considering a broader problem :
What is the right format for a video file so that it can be embedded easily in a TW ?
The videos are on my computer, so is the TW.
I'm able to convert the files (I'm on ubuntu with avidemux, and firefox as a browser).

And second question : what html tag to use ?
<object>, <embed> or <video> ?

Any advice would be useful !

Thanks

FrD

FrD

unread,
Feb 3, 2012, 1:34:47 PM2/3/12
to tiddl...@googlegroups.com
Hello,

I've made some progress.
This works (in Firefox with the vlc plugin) :

<html>
<object data="myfile.avi" type="application/x-vlc-plugin" width="400" height="300" autostart="no" id="vlc"></object>

</html>
<script label="play">
var vlc = document.getElementById("vlc");
vlc.playlist.play();
</script>

This works too (probably without the need of vlc) with an .mp4 file :
<object data="myfile.mp4" width="400" height="300"></object>

This doesn't work :
<video src="myfile.flv" width="400" height="300" controls>  Your browser does not support the <code>video</code> element.
</video>

BUT it works with an URL like http:// ...

FrD

perlguy

unread,
Feb 4, 2012, 8:20:07 PM2/4/12
to TiddlyWiki
This seems to work just fine... though, in Firefox 3.x it seems a bit
unstable (I use FF3 with prism plugin to have standalone tiddlywiki
apps). Under the latest FF it works great.

<html>
<embed type="application/x-vlc-plugin"
autoplay="false" loop="true"
width="320" height="240"
id="vlc"
src="sample.avi" />
</html>

<script label="Play">
var vlc= document.getElementById("vlc");
vlc.playlist.play();
</script>

<script label="Stop">
var vlc= document.getElementById("vlc");
vlc.playlist.stop();
</script>

FrD

unread,
Feb 5, 2012, 9:07:00 AM2/5/12
to tiddl...@googlegroups.com
Thanks for the test.

Finally I use the <video> tag (html5) in both firefox 10 and IE 9.
It works natively in IE with an mp4 file (H264/mp4) and in firefox with an ogg file.

Firefox :
<video width="400" height="300" poster="myposter.png" controls> 
   <source  src="myfile.ogg" />
</video>

IE :
<video width="400" height="300" poster="myposter.png" controls> 
   <source  src="myfile.mp4" />
</video>

So I guess the following should work in both, but you have to have two video files :

<video width="400" height="300" poster="myposter.png" controls> 
   <source  src="myfile.mp4" />
   <source  src="myfile.ogg" />
</video>

Or, last solution : use the ogg file and install ogg codecs in IE.

FrD


perlguy

unread,
Feb 6, 2012, 3:30:32 PM2/6/12
to TiddlyWiki
Oh! One thing I forgot to mention, in case anyone else stumbles on
this thread. I had to re-install VLC using their installer, to get it
working. Using the portable version (simple zip file) wasn't working.

I had been upgrading with zip files overwriting previous versions, but
hadn't been using the plugin until this thread. I noticed during the
install that it updates the plugin. By using the portable version,
the plugin dll wasn't getting updated - which seems to be what causes
the black window with no output. The plugin loads, but it can't find
all the other bits of vlc to be able to decode and playback.

HTH

--Jim
Reply all
Reply to author
Forward
0 new messages