Home All Groups Group Topic Archive Search About
Author
23 Apr 2007 5:40 PM
Greg S
I have a Window Media Player control embedded in my page... and a Listbox
that has a list of files on a certain network share (all video files). When
the user selects from the listbox and clicks a button, I want the WMP control
to play that video.
I am passing the correct path to the player's URL property, but I can't get
the video to play. The control goes to "Ready" for a split second, but then
it looks like the page refreshes and then, nothing. Here is my Javascript to
pass the correct path to the player:

    <script type="text/javascript">
        function setPlayerURL() {
            player = document.getElementById("wmpWindow")
            myURL =
document.getElementById("pathStore").getAttribute("value");
            player.URL = myURL;
            player.controls.play();
        }
    </script>

Author
24 Apr 2007 1:11 AM
Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
My guess would be it doesn't like the URL you're giving it.
Perhaps the filename is incorrect or it doesn't like the path you're
supplying (if any).  Try supplying the full absolute URL to the media file
and see if that helps.

Here's more info:
http://SteveOrr.net/articles/StreamingMedia.aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net



Show quote
"Greg S" <Greg S@discussions.microsoft.com> wrote in message
news:313B1A10-8BA5-40FD-8AC3-D1D156AB2DDB@microsoft.com...
>I have a Window Media Player control embedded in my page... and a Listbox
> that has a list of files on a certain network share (all video files).
> When
> the user selects from the listbox and clicks a button, I want the WMP
> control
> to play that video.
> I am passing the correct path to the player's URL property, but I can't
> get
> the video to play. The control goes to "Ready" for a split second, but
> then
> it looks like the page refreshes and then, nothing. Here is my Javascript
> to
> pass the correct path to the player:
>
>    <script type="text/javascript">
>        function setPlayerURL() {
>            player = document.getElementById("wmpWindow")
>            myURL =
> document.getElementById("pathStore").getAttribute("value");
>            player.URL = myURL;
>            player.controls.play();
>        }
>    </script>
Author
26 Apr 2007 1:06 PM
Greg S
The URL i am supplying is legit. I am storing it in a textbox for the time
being so I can see what it is. I copy and paste that into the Windows run
line, full-blown WMP opens and plays, no problem. I also put it in quotes,
and get the same result.

If I comment out the line:
player.URL = myURL;
nothing happens to the embedded player. With that line in there, the player
displays "Ready" for a second before the page refreshes and loses the ability
to play.

Show quote
"Steve C. Orr [MCSD, MVP, CSM, ASP Inside" wrote:

> My guess would be it doesn't like the URL you're giving it.
> Perhaps the filename is incorrect or it doesn't like the path you're
> supplying (if any).  Try supplying the full absolute URL to the media file
> and see if that helps.
>
> Here's more info:
> http://SteveOrr.net/articles/StreamingMedia.aspx
>
> --
> I hope this helps,
> Steve C. Orr,
> MCSD, MVP, CSM, ASPInsider
> http://SteveOrr.net
>
>
>
> "Greg S" <Greg S@discussions.microsoft.com> wrote in message
> news:313B1A10-8BA5-40FD-8AC3-D1D156AB2DDB@microsoft.com...
> >I have a Window Media Player control embedded in my page... and a Listbox
> > that has a list of files on a certain network share (all video files).
> > When
> > the user selects from the listbox and clicks a button, I want the WMP
> > control
> > to play that video.
> > I am passing the correct path to the player's URL property, but I can't
> > get
> > the video to play. The control goes to "Ready" for a split second, but
> > then
> > it looks like the page refreshes and then, nothing. Here is my Javascript
> > to
> > pass the correct path to the player:
> >
> >    <script type="text/javascript">
> >        function setPlayerURL() {
> >            player = document.getElementById("wmpWindow")
> >            myURL =
> > document.getElementById("pathStore").getAttribute("value");
> >            player.URL = myURL;
> >            player.controls.play();
> >        }
> >    </script>
>
Author
26 Apr 2007 1:20 PM
Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
My next guess would be a security issue.
You say it runs fine within windows, but ASP.NET runs under a different
security context.
Where is the media file located?  Is it within the web application's folder?
What is the URL you're using?

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net


Show quote
"Greg S" <Gr***@discussions.microsoft.com> wrote in message
news:90B2811C-D3E5-47FE-A559-4C8AD8C8C580@microsoft.com...
> The URL i am supplying is legit. I am storing it in a textbox for the time
> being so I can see what it is. I copy and paste that into the Windows run
> line, full-blown WMP opens and plays, no problem. I also put it in quotes,
> and get the same result.
>
> If I comment out the line:
> player.URL = myURL;
> nothing happens to the embedded player. With that line in there, the
> player
> displays "Ready" for a second before the page refreshes and loses the
> ability
> to play.
>
> "Steve C. Orr [MCSD, MVP, CSM, ASP Inside" wrote:
>
>> My guess would be it doesn't like the URL you're giving it.
>> Perhaps the filename is incorrect or it doesn't like the path you're
>> supplying (if any).  Try supplying the full absolute URL to the media
>> file
>> and see if that helps.
>>
>> Here's more info:
>> http://SteveOrr.net/articles/StreamingMedia.aspx
>>
>> --
>> I hope this helps,
>> Steve C. Orr,
>> MCSD, MVP, CSM, ASPInsider
>> http://SteveOrr.net
>>
>>
>>
>> "Greg S" <Greg S@discussions.microsoft.com> wrote in message
>> news:313B1A10-8BA5-40FD-8AC3-D1D156AB2DDB@microsoft.com...
>> >I have a Window Media Player control embedded in my page... and a
>> >Listbox
>> > that has a list of files on a certain network share (all video files).
>> > When
>> > the user selects from the listbox and clicks a button, I want the WMP
>> > control
>> > to play that video.
>> > I am passing the correct path to the player's URL property, but I can't
>> > get
>> > the video to play. The control goes to "Ready" for a split second, but
>> > then
>> > it looks like the page refreshes and then, nothing. Here is my
>> > Javascript
>> > to
>> > pass the correct path to the player:
>> >
>> >    <script type="text/javascript">
>> >        function setPlayerURL() {
>> >            player = document.getElementById("wmpWindow")
>> >            myURL =
>> > document.getElementById("pathStore").getAttribute("value");
>> >            player.URL = myURL;
>> >            player.controls.play();
>> >        }
>> >    </script>
>>
Author
26 Apr 2007 1:44 PM
Greg S
No, it is not in the application's root folder- there are about 1000 video
files so they live on a Windows Storage Server. So it is a fully qualified
path. An example of one of the files:

"\\wss\Video Presentations\2007\Profiles\video.avi"

This is the exact string getting passed to the player... is it not possible
to play media that are not in the app's root folder?

I don't think it is a security issue- at first page load, the app scans the
entire share and populates a listbox with all media files in the directory
and its subfolders. If it was a security issue, it wouldn't be able to do
that. I took some code to impersonate a user- i am impersonating myself, and
I am a domain admin.

Show quote
"Steve C. Orr [MCSD, MVP, CSM, ASP Inside" wrote:

> My next guess would be a security issue.
> You say it runs fine within windows, but ASP.NET runs under a different
> security context.
> Where is the media file located?  Is it within the web application's folder?
> What is the URL you're using?
>
> --
> I hope this helps,
> Steve C. Orr,
> MCSD, MVP, CSM, ASPInsider
> http://SteveOrr.net
>
>
> "Greg S" <Gr***@discussions.microsoft.com> wrote in message
> news:90B2811C-D3E5-47FE-A559-4C8AD8C8C580@microsoft.com...
> > The URL i am supplying is legit. I am storing it in a textbox for the time
> > being so I can see what it is. I copy and paste that into the Windows run
> > line, full-blown WMP opens and plays, no problem. I also put it in quotes,
> > and get the same result.
> >
> > If I comment out the line:
> > player.URL = myURL;
> > nothing happens to the embedded player. With that line in there, the
> > player
> > displays "Ready" for a second before the page refreshes and loses the
> > ability
> > to play.
> >
> > "Steve C. Orr [MCSD, MVP, CSM, ASP Inside" wrote:
> >
> >> My guess would be it doesn't like the URL you're giving it.
> >> Perhaps the filename is incorrect or it doesn't like the path you're
> >> supplying (if any).  Try supplying the full absolute URL to the media
> >> file
> >> and see if that helps.
> >>
> >> Here's more info:
> >> http://SteveOrr.net/articles/StreamingMedia.aspx
> >>
> >> --
> >> I hope this helps,
> >> Steve C. Orr,
> >> MCSD, MVP, CSM, ASPInsider
> >> http://SteveOrr.net
> >>
> >>
> >>
> >> "Greg S" <Greg S@discussions.microsoft.com> wrote in message
> >> news:313B1A10-8BA5-40FD-8AC3-D1D156AB2DDB@microsoft.com...
> >> >I have a Window Media Player control embedded in my page... and a
> >> >Listbox
> >> > that has a list of files on a certain network share (all video files).
> >> > When
> >> > the user selects from the listbox and clicks a button, I want the WMP
> >> > control
> >> > to play that video.
> >> > I am passing the correct path to the player's URL property, but I can't
> >> > get
> >> > the video to play. The control goes to "Ready" for a split second, but
> >> > then
> >> > it looks like the page refreshes and then, nothing. Here is my
> >> > Javascript
> >> > to
> >> > pass the correct path to the player:
> >> >
> >> >    <script type="text/javascript">
> >> >        function setPlayerURL() {
> >> >            player = document.getElementById("wmpWindow")
> >> >            myURL =
> >> > document.getElementById("pathStore").getAttribute("value");
> >> >            player.URL = myURL;
> >> >            player.controls.play();
> >> >        }
> >> >    </script>
> >>
>
Author
26 Apr 2007 4:26 PM
Greg S
As you were leading on, the problem is that the app wants the file to be in
its root folder. So the URL is actually ending up as this:

http://localhost:1464/app1/"/wss/Video Presentations/...

Is there a way to get rid of that, and play files NOT in the root?
Author
2 May 2007 6:06 AM
Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
You could create a special page (or HTTPHandler) to dish out the files.
It would probably use the Response.WriteFile method to grab the specified
file from the share and output it.
This would also allow you to change the file location in the future more
easily.
Here's more info:
http://msdn2.microsoft.com/en-us/library/aa332830(vs.71).aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net


Show quote
"Greg S" <Gr***@discussions.microsoft.com> wrote in message
news:19264B06-FB41-4CA2-9500-CBB66E339C79@microsoft.com...
> As you were leading on, the problem is that the app wants the file to be
> in
> its root folder. So the URL is actually ending up as this:
>
> http://localhost:1464/app1/"/wss/Video Presentations/...
>
> Is there a way to get rid of that, and play files NOT in the root?
Author
7 May 2007 12:05 AM
Greg S
Thanks for all your help. I figured it out. Simple as changing my button from
an ASP button to a regular HTML button.
Hey, I told you I'm new at this.
Again, thanks for working with me on this.

Show quote
"Steve C. Orr [MCSD, MVP, CSM, ASP Inside" wrote:

> You could create a special page (or HTTPHandler) to dish out the files.
> It would probably use the Response.WriteFile method to grab the specified
> file from the share and output it.
> This would also allow you to change the file location in the future more
> easily.
> Here's more info:
> http://msdn2.microsoft.com/en-us/library/aa332830(vs.71).aspx
>
> --
> I hope this helps,
> Steve C. Orr,
> MCSD, MVP, CSM, ASPInsider
> http://SteveOrr.net
>
>
> "Greg S" <Gr***@discussions.microsoft.com> wrote in message
> news:19264B06-FB41-4CA2-9500-CBB66E339C79@microsoft.com...
> > As you were leading on, the problem is that the app wants the file to be
> > in
> > its root folder. So the URL is actually ending up as this:
> >
> > http://localhost:1464/app1/"/wss/Video Presentations/...
> >
> > Is there a way to get rid of that, and play files NOT in the root?
>

AddThis Social Bookmark Button