vlc plugin - URI protocol path bugs

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
Shadow2531
Blank Cone
Blank Cone
Posts: 13
Joined: 01 Apr 2007 12:04

vlc plugin - URI protocol path bugs

Postby Shadow2531 » 27 Apr 2007 10:57

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).

Shadow2531
Blank Cone
Blank Cone
Posts: 13
Joined: 01 Apr 2007 12:04

Re: vlc plugin - URI protocol path bugs

Postby Shadow2531 » 26 Sep 2007 15:28

Any news?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: vlc plugin - URI protocol path bugs

Postby Jean-Baptiste Kempf » 27 Sep 2007 01:54

What versions are you using?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

funman
Developer
Developer
Posts: 1159
Joined: 03 Sep 2006 04:03
VLC version: master
Operating System: All of them
Location: Lost, please help me

Re: vlc plugin - URI protocol path bugs

Postby funman » 27 Sep 2007 17:56

if 'hostname' refers to a Samba (windows shared) host, you should use smb:// instead.

Shadow2531
Blank Cone
Blank Cone
Posts: 13
Joined: 01 Apr 2007 12:04

Re: vlc plugin - URI protocol path bugs

Postby Shadow2531 » 06 Oct 2007 05:04

What versions are you using?
Latest stable.

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

Shadow2531
Blank Cone
Blank Cone
Posts: 13
Joined: 01 Apr 2007 12:04

Re: vlc plugin - URI protocol path bugs

Postby Shadow2531 » 06 Oct 2007 11:25

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.


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 5 guests