problem dynamically assigning a streaming source
Last post 05-01-2008 6:10 PM by rumremix. 2 replies.
Sort Posts:
04-29-2008 4:18 PM
problem dynamically assigning a streaming source

I have a media element for which I wish to dynamically set the source. I'm able to do this for local video, but not for a streaming source. the following scenarios illustrate my problem:

Hard-coded embeded video source. This works:

<MediaElement  AutoPlay="false" Name="mediaBox"  Source="localVid.wmv"  />

Hard-coded streamed video source. This works:

<MediaElement  AutoPlay="false" Name="mediaBox"  Source="http://play.rbn.com/play.asx?url=cspan/cspan/wmlive/cspan1v.asf"  />

Dynamically assigned embeded video source. This works:

<MediaElement  AutoPlay="false" Name="mediaBox"  Source=""  />
in javascript file: sender.findName("mediaBox").setSource(sender,"localVid.wmv");

Dynamically assigned streamed video source. This throws an AG_Runtime_Method error:

<MediaElement  AutoPlay="false" Name="mediaBox"  Source=""  />
in javascript file: sender.findName("mediaBox").setSource(sender,"http://play.rbn.com/play.asx?url=cspan/cspan/wmlive/cspan1v.asf");

 

Why can't I dynamically assign the streaming source without throwing an error?

Any suggestions would be greatly appreciated.

rumremix

Joined on 10-19-2007
Posts 41
04-30-2008 10:01 PM
Marked as Answer
Re: problem dynamically assigning a streaming source

Hi:

  setSource is used for the downloaded viedo:

http://msdn.microsoft.com/en-us/library/bb979889.aspx

  In your case you should try:

sender.findName("mediaBox").source="http://play.rbn.com/play.asx?url=cspan/cspan/wmlive/cspan1v.asf";

Regards

Sincerely,
Allen Chen
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Allen Chen – MSFT

Joined on 03-16-2007
Posts 717
05-01-2008 6:10 PM
Re: problem dynamically assigning a streaming source

Thanks, Allen. That works!

rumremix

Joined on 10-19-2007
Posts 41