Page 1 of 1

vlc plugin - URI protocol path bugs

Posted: 27 Apr 2007 10:57
by Shadow2531
Problem 1:

In Opera, set "application/x-vlc-plugin" to use with the VLC plugin. (Under tools -> preferences -> advanced -> downloads)

Put a test.html and test.ogg on your desktop (WinXP admin account will do)

test.html:

Code: Select all

<object type="application/x-vlc-plugin" width="320" height="240"> <param name="mrl" value="test.ogg"> <param name="autoplay" value="true"> <param name="version" value="VideoLAN.VLCPlugin.2"> </object>
Load test.html in Opera. The plugin should start up and the video should start playing.

The file will not play though because the plugin can't find the file.


Problem 2:
In Opera, goto "file -> open" and choose to open the test.ogg that's on your desktop.

The plug-in will load (it sometimes hangs also), but the file does not play because the plugin can't find the file.


For 1 and 2, it appears that the plugin calls document.location and uses that to determine a path to the desktop directory so test.ogg can be found.

The problem here is that the plugin only partially supports the file protocol.

A file URI looks like this:

file://hostname/drive:/foo/bar
file://localhost/drive:/foo/bar or file:///drive:/foo/bar
file://intranet_server/foo/bar or file://///intranet_server/foo/bar

The plugin appears to only support file:/// (and file:///// for intranet). It seems to choke on file://localhost/ (and file://instranet_server/) when determining the path and the file is not found.

Now, Firefox uses file:///, so you won't normally see this problem. However, Firefox supports file://hostname/ URIs if you paste them in its address field, so you can reproduce this problem in Firefox also.

The Netscape Windows Media Player 6.4 plugin suffers from this problem also.
For reference, there is a JS workaround for it. That type of thing may work for the VLC plugin, but it should in no way be necessary.


Problem 3:

In Opera's built-in email client M2, you can choose to open or save message attachments. If you receive an .ogg file, you can right-click on the attachment and choose to save or open it. If the .ogg extension is set in Opera to open with the vlc plugin and you choose to open the attachment, Opera will open the attachment:// URI (that references the .ogg attachment) in a new tab.

For example, if you open the attachment test.ogg, attachment:/9/test.ogg (for example) will open in a new tab. Now, because the address ends in .ogg, the vlc plugin will start, but the file won't play.

Again, the file doesn't play because the plug-in can't find the file. It's probably looking at document.location and using that to determine a base path to find the file in Opera's cache. However, trying to create a base path out of an attachment URI isn't going to work. The vlc plugin needs to use other means to get the path to the file.

The DivX plugin has this problem also, but they are working on fixing it.

The flash plugin handles this situation perfectly and plays the file, so it's certainly possible to fix this.

Problem 4:

Opera and Firefox support data URIs. You can load the same HTML markup as used in test.html above via a data URI. However, the file won't play because it can't be found. Using document.location again won't work here.

Problem 5:

You can create a bookmarklet that loads the same HTML markup as used in test.html above. However, again, the file won't play because it can't be found. Using document.location again won't work here.

Problem 6:

For 4 and 5, if the location in the address field is really, really long, the plugin might choke when checking out document.location.

For example, a data URI like "data:application/x-vlc-plugin;base64,a_4MB_.OGG_FILE_encoded_as_base64" might give the plugin a problem.

The plugin should handle this situation by not crashing (because it'll take the browser with it) and possibly display an error that it doesn't support data URIs.

Summary:

To determine the base path and or get the location of the file, the plugin needs to use something else besides document.location (or whatever method is currently being used).

Re: vlc plugin - URI protocol path bugs

Posted: 26 Sep 2007 15:28
by Shadow2531
Any news?

Re: vlc plugin - URI protocol path bugs

Posted: 27 Sep 2007 01:54
by Jean-Baptiste Kempf
What versions are you using?

Re: vlc plugin - URI protocol path bugs

Posted: 27 Sep 2007 17:56
by funman
if 'hostname' refers to a Samba (windows shared) host, you should use smb:// instead.

Re: vlc plugin - URI protocol path bugs

Posted: 06 Oct 2007 05:04
by Shadow2531
What versions are you using?
Latest stable.

I'll try with a nightly to see if anything is fixed in this area.

Re: vlc plugin - URI protocol path bugs

Posted: 06 Oct 2007 11:25
by Shadow2531
I tried with the latest nightly. The plugin doesn't play any files and the player is really unstable. I'll keep trying new ones as they come to see if I'm able to test.