[RESOLVED] object (movie) not playing live - works on local
I have a small web app (using vb.net/asp.net) that I have created a control with an oject and I show a short video. The video is a .mov file. When I run the page on my local testing machine, it works just fine. When I move the files to the server and test it, the movie just won't play. There are no errors on the page or anything, the movie just won't play. I know the path to the video is correct. When I click play, it says 'Opening Media' for 1 or 2 seconds and then it goes back to the ready state. I'm wondering why it works locally but not on the server. Does the server need a media player?
Here's my control:
HTML Code:
<object id="<%= ClientID %>_Player" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="<%= Me.Width %>" height="<%= Me.Height %>" style="margin:0px auto; z-index:10000">
<param name="URL" value="<%= me.VideoUrl %>" />
<param name="autoStart" value="false" />
<param name="uimode" value="Full" />
<%--<param name="autoplay" value="True" />--%>
<embed id="<%= ClientID %>_Embed" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" width="<%= Me.Width %>" height="<%= Me.Height %>" src="<%= Me.VideoUrl %>" style="margin:0px auto;z-index:10000" showcontrols="0">
</object>
Then on my .aspx source page I call the control like this:
HTML Code:
<uc2:cntVideo ID="cntVideo1" runat="server" Height="242"
Width="315" VideoUrl="<%= VideoFile %>" />
And finally in that .aspx code behind I set the path:
Code:
VideoPath = "C:/Videos/DWI_labtable_assembly.mov"
cntVideo1.VideoUrl = VideoPath
Any help would be greatly appreciated. Please let me know if you have any questions or ideas. Thanks!
Re: object (movie) not playing live - works on local
Hello,
I believe the problem here is that you are not using a path, relative to the server. You are using C:\, which basically means, try and get the file from the C:\ drive of the client machine, which clearly won't exist. Provide either a relative path to the file, i.e. /Videos/DWI_labtable_assembly.mov, or, provide an absolute url, i.e. http://www.yourdomain.com/Videos/DWI...e_assembly.mov.
Gary
Re: object (movie) not playing live - works on local
Huh, that was it! I actually wasn't hard coding a path in, this is what i was originally using:
Code:
Dim VideoFiles() As String
VideoFiles = IO.Directory.GetFiles(Server.MapPath(path))
and then I'd loop through each one to grab the file name and path and i just used that full path. When I used only the relative path, it works now. Thank you so much!!!!!!!! :thumb:
Re: object (movie) not playing live - works on local
Not a problem at all, happy to help!
Can you remember to mark your thread as resolved?
Thanks
Gary