playing local video clips |
playing local video clips |
asa rand |
Dec 6 2006, 02:50 PM
Post
#1
|
Novice Group: Members Posts: 21 Joined: 4-December 06 Member No.: 1,205 |
I have an <OBJECT> tag setup to play a video clip that is local on my hard drive. When I try to play it nothing happens. Based on what happens when I try to pass it to Windows Media Player (which says it cannot play the file), I figured out what the problem is. Now I need to find out how to fix it.
The problem is that the filepath is being resolved as "C:/My%20Documents/...", and Windows Media Player can't find the file. How do I get the player to resolve the filepath as "C:/My Documents/..." so the file can be found? In the code for the object, I have the src attr set as src="Video/filename.wmv". I tried using src="/Video/filename.wmv", but the player wouldn't even display in the window. I also tried using a complete filepath, beginning with "file:///C:/My Documents/..." but that didn't work either. |
jimlongo |
Dec 6 2006, 03:04 PM
Post
#2
|
This is My Life Group: Members Posts: 1,128 Joined: 24-August 06 From: t-dot Member No.: 16 |
Did you try
CODE src="C:/My%20Documents/Video/filename.wmv" or maybe this . . . (I don't know Windows) CODE src="file:///C:/My%20Documents/Video/filename.wmv" You need the %20 for the space in My Documents This post has been edited by jimlongo: Dec 6 2006, 03:05 PM |
asa rand |
Dec 6 2006, 06:54 PM
Post
#3
|
Novice Group: Members Posts: 21 Joined: 4-December 06 Member No.: 1,205 |
Did you try CODE src="C:/My%20Documents/Video/filename.wmv" or maybe this . . . (I don't know Windows) CODE src="file:///C:/My%20Documents/Video/filename.wmv" You need the %20 for the space in My Documents The browser gets the path and replaces all spaces with %20. Windows Media Player doesn't seem to be able to convert the %20s back to spaces. I need to know how to get the %20s converted back to spaces when the player receives the filepath string. |
jimlongo |
Dec 6 2006, 07:04 PM
Post
#4
|
This is My Life Group: Members Posts: 1,128 Joined: 24-August 06 From: t-dot Member No.: 16 |
I'll admit to not knowing squat about Windows Media Player, but it's the browser that retrieves the file and hands it to the plug-in. What does the player have to do with spaces in the URL. It should be able to play the file the browser hands it.
|
Peter1968 |
Dec 6 2006, 07:16 PM
Post
#5
|
Serious Coder Group: Members Posts: 448 Joined: 23-September 06 Member No.: 213 |
The browser gets the path and replaces all spaces with %20. Windows Media Player doesn't seem to be able to convert the %20s back to spaces. I need to know how to get the %20s converted back to spaces when the player receives the filepath string. Move to the files to a directory that has no spaces in it - there's nothing stopping you from doing that. |
asa rand |
Dec 6 2006, 07:53 PM
Post
#6
|
Novice Group: Members Posts: 21 Joined: 4-December 06 Member No.: 1,205 |
The browser gets the path and replaces all spaces with %20. Windows Media Player doesn't seem to be able to convert the %20s back to spaces. I need to know how to get the %20s converted back to spaces when the player receives the filepath string. Move to the files to a directory that has no spaces in it - there's nothing stopping you from doing that. Well, I can't rename 'My Documents' to MyDocuments or My_Documents, and it's not just the local directory that's the problem. In fact, the directory the vid clips are in is named 'Video'. Anyway, I found out that the problem is Firefox. If I load the page into Internet Explorer the vid clip plays just fine in the window and the link to pass it to WMP externally works too. It just doesn't work in Firefox. |
asa rand |
Dec 6 2006, 08:01 PM
Post
#7
|
Novice Group: Members Posts: 21 Joined: 4-December 06 Member No.: 1,205 |
I'll admit to not knowing squat about Windows Media Player, but it's the browser that retrieves the file and hands it to the plug-in. What does the player have to do with spaces in the URL. It should be able to play the file the browser hands it. Well, it seems as though WMP is being passed a filepath string, and WMP says it can't find the file. Checking the error details it shows the filepath spec being passed is 'C:/My%20Documents/...' ... since WMP doesn't find a folder named My%20Documents, the load fails with a file not found or bad pathname error. As I stated in my other reply, I found that the problem is in the way Firefox passes the filepath. The same page in Internet Explorer works without a problem. |
pandy |
Dec 6 2006, 09:04 PM
Post
#8
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
There's nothing wrong with the %20. You have the HTML on your local drive too, don't you? Because if you try to do this from a server, IE may let you but I doubt any other browser will.
|
asa rand |
Dec 6 2006, 09:25 PM
Post
#9
|
Novice Group: Members Posts: 21 Joined: 4-December 06 Member No.: 1,205 |
There's nothing wrong with the %20. You have the HTML on your local drive too, don't you? Because if you try to do this from a server, IE may let you but I doubt any other browser will. All I know is that Windows Media Player says it can't find the file when it's passed from Firefox and has no problem when it's passed from Internet Explorer. And the only difference is the file path. When Firefox passes it it comes out: "C:/Documents%20and%20Settings/User/My%20Documents/..." and when Internet Explorer passes it it comes out: "C:/Documents and Settings/User/My Documents/..." I know that browser wise %20 and a space character are the same thing, but Windows Media Player doesn't see it that way, and apparently neither does the plugin. |
pandy |
Dec 6 2006, 10:51 PM
Post
#10
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
But surely you must know if you have the HTML page on a server of if it is on your own hard drive?
|
asa rand |
Dec 6 2006, 10:59 PM
Post
#11
|
Novice Group: Members Posts: 21 Joined: 4-December 06 Member No.: 1,205 |
But surely you must know if you have the HTML page on a server of if it is on your own hard drive? Oops. I'm sorry. Perhaps I never made it clear. I am trying to view the vid clip from my hard drive, not a server somewhere else on the net. As a result, the browser has to resolve the local filepath and not a url. When Firefox does this, it converts all space characters in the filepath to %20s. When it passes the string to the plugin (or to the external player) it doesn't convert the %20s back to spaces. While %20 is the browsers way of dealing with spaces so the HTTP engines don't cough, the strings "My Documents" and "My%20Documents" are not the same. The plugin and the external player both look for the exact string, and do not parse the %20s as spaces. |
Peter1968 |
Dec 7 2006, 03:14 AM
Post
#12
|
Serious Coder Group: Members Posts: 448 Joined: 23-September 06 Member No.: 213 |
Once again, if the spaces are giving you so much trouble why *must* your songs be in the My Documents directory? Why not move them to a single word directory? What is stopping you from doing that?
Sorry, I'm having dramas understanding why you don't keep things simple and do that. |
asa rand |
Dec 7 2006, 01:54 PM
Post
#13
|
Novice Group: Members Posts: 21 Joined: 4-December 06 Member No.: 1,205 |
Once again, if the spaces are giving you so much trouble why *must* your songs be in the My Documents directory? Why not move them to a single word directory? What is stopping you from doing that? Sorry, I'm having dramas understanding why you don't keep things simple and do that. 1. Simple is fine, but doesn't solve the problem. As to why I want to keep things where they are? 2. Because I want to. 3. That's what My Documents is for. 4. I can organize all of my files in one place. 5. I don't have to clutter my desktop with folder icons. The most important thing, for me, is that I like to fix what's broken, not find a "simple solution" that avoids finding the cause. In this case the cause is Firefox. It has some bad code that has to be rewritten. |
pandy |
Dec 7 2006, 02:53 PM
Post
#14
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
I think you make assumptions that aren't necessarily right.
Could you, as an experiment, copy the HTML to the directory where the video file is and edit the path so it's just the file name? Then see if it works in FF. |
asa rand |
Dec 7 2006, 03:23 PM
Post
#15
|
Novice Group: Members Posts: 21 Joined: 4-December 06 Member No.: 1,205 |
I think you make assumptions that aren't necessarily right. Could you, as an experiment, copy the HTML to the directory where the video file is and edit the path so it's just the file name? Then see if it works in FF. Actually, I already did that. Firefox still has to complete the entire path and pass it to the plugin/external app, and the spaces in "Documents and Settings" and in "My Documents" were replaced with %20s. I will recreate it, take screenshots and post both code and screenshots here. Maybe you can then see something I may be missing. This post has been edited by asa rand: Dec 7 2006, 03:24 PM |
Christian J |
Dec 7 2006, 03:35 PM
Post
#16
|
. Group: WDG Moderators Posts: 9,653 Joined: 10-August 06 Member No.: 7 |
All I know is that Windows Media Player says it can't find the file when it's passed from Firefox and has no problem when it's passed from Internet Explorer. And the only difference is the file path. When Firefox passes it it comes out: "C:/Documents%20and%20Settings/User/My%20Documents/..." Just noticed that IE has been doing the same thing all along. This post has been edited by Christian J: Dec 7 2006, 04:47 PM |
jimlongo |
Dec 7 2006, 03:35 PM
Post
#17
|
This is My Life Group: Members Posts: 1,128 Joined: 24-August 06 From: t-dot Member No.: 16 |
If you're so sure it's a Firefox problem, then I'd suggest you're not going to get any help here.
http://kb.mozillazine.org/Windows_Media_Player |
asa rand |
Dec 7 2006, 03:47 PM
Post
#18
|
Novice Group: Members Posts: 21 Joined: 4-December 06 Member No.: 1,205 |
OK. Here are the results. I copied the page into the same folder and edited the src="filename" attributes to reflect current directory, as follows:
CODE <!-- begin embedded WindowsMedia file... --> <OBJECT id='mediaPlayer' width="320" height="285" classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'> <PARAM name='fileName' value="001_belias_sm.wmv"> <PARAM name='animationatStart' value='true'> <PARAM name='transparentatStart' value='true'> <PARAM name='autoStart' value="true"> <PARAM name='showControls' value="true"> <PARAM name='loop' value="false"> <EMBED type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1' bgcolor='darkblue' showcontrols="true" showtracker='-1' showdisplay='0' showstatusbar='-1' videoborder3d='-1' width="320" height="285" src="001_belias_sm.wmv" autostart="true" designtimesp='5311' loop="false"> </EMBED> </OBJECT> <!-- ...end embedded WindowsMedia file --> <!-- begin link to launch external media player... --> <A href="001_belias.wmv" style='font-size: 85%;' target='_blank'>Launch in external player</A> <!-- ...end link to launch external media player... --> Here is the properties as shown when the player on the page is right-clicked and properties selected: Here is the error message the external player displays when the filespec is passed to it: Here is the properties WMP shows for the filespec passed: |
asa rand |
Dec 7 2006, 03:50 PM
Post
#19
|
Novice Group: Members Posts: 21 Joined: 4-December 06 Member No.: 1,205 |
If you're so sure it's a Firefox problem, then I'd suggest you're not going to get any help here. http://kb.mozillazine.org/Windows_Media_Player I'm already working on getting help from Firefox. When I posted here it was because I thought maybe I had an error in my code. Then I found that IE7 didn't have any trouble with the page or the file. |
jimlongo |
Dec 7 2006, 04:22 PM
Post
#20
|
This is My Life Group: Members Posts: 1,128 Joined: 24-August 06 From: t-dot Member No.: 16 |
Also you may be faced with the daunting task that Firefox will tell you that it's the plug-in that is causing the problem.
So you would then be looking at Microsoft support. But since it works in IE I doubt you'd have much success suggesting to them that there is any problem at all. |
Lo-Fi Version | Time is now: 19th April 2024 - 10:21 PM |