| Author |
Message |
Steve
Guest
|
Posted:
Fri Apr 08, 2005 11:19 pm Post subject:
Embeded Player & VB.NET |
|
|
I am having an issue with trying to access the properties of the WMP10 from
within my webform application. I have tried to follow the SDK and I have the
video playing... BUT. I need to be able to control which video the player
plays at certain points during a page. For example... if the user chooses
one option Video X will play if they choose a different option then Video Y
will play. I'm guess that i will create a play list & the invoke the video
via a play list...but currently I can't even access the WMP object. Do I
need to access these properties all from javascript? Can I access them from
within my webform code?
Sorry for the newbie question.
Thanks.
|
|
| Back to top |
|
 |
Neil Smith [MVP Digital M
Guest
|
Posted:
Sat Apr 09, 2005 11:04 am Post subject:
Re: Embeded Player & VB.NET |
|
|
On Fri, 8 Apr 2005 16:19:03 -0700, "Steve"
<Steve@discussions.microsoft.com> wrote:
| Quote: | I am having an issue with trying to access the properties of the WMP10 from
within my webform application. I have tried to follow the SDK and I have the
video playing... BUT. I need to be able to control which video the player
plays at certain points during a page. For example... if the user chooses
|
You need to do this client side - the server side has no idea what's
happening, much as if you wanted to control a flash movie or a
quicktime player ! Assume your HTML ID for the player is
"MediaPlayer". Your javascript function would contain a line such as
function setPlayerURL(myURL) {
player=document.getElementById("MediaPlayer");
player.URL=myURL;
player.controls.play();
}
You might want to call the function above with an onchange event from
a dropdown list (if I read your question right) so let's say each
option element has a value of the URL (path to video eg
<option value="http://path/to/your/video.wmv">Video1</option> )
Then on the select element you'd use
<select name="blah" id="blah"
onchange="setPlayerURL(this[this.selectedIndex].value)">
| Quote: | one option Video X will play if they choose a different option then Video Y
will play. I'm guess that i will create a play list & the invoke the video
via a play list...but currently I can't even access the WMP object. Do I
need to access these properties all from javascript? Can I access them from
within my webform code?
|
I don't see how you can do this : If you do a postback then you've
just unloaded the embedded media player object. It's only available on
the client once the page has loaded - I can't see how it can be
available to the server side code.
Just set the player's <param name="url" value="blah.wmv" /> when the
page is created, that should take care of it.
Cheers - Neil |
|
| Back to top |
|
 |
Steve
Guest
|
Posted:
Mon Apr 11, 2005 3:09 pm Post subject:
Re: Embeded Player & VB.NET |
|
|
Thank you for your help Neil.... couple more questions below...
"Neil Smith [MVP Digital Media]" wrote:
| Quote: | On Fri, 8 Apr 2005 16:19:03 -0700, "Steve"
Steve@discussions.microsoft.com> wrote:
I am having an issue with trying to access the properties of the WMP10 from
within my webform application. I have tried to follow the SDK and I have the
video playing... BUT. I need to be able to control which video the player
plays at certain points during a page. For example... if the user chooses
You need to do this client side - the server side has no idea what's
happening, much as if you wanted to control a flash movie or a
quicktime player ! Assume your HTML ID for the player is
"MediaPlayer". Your javascript function would contain a line such as
function setPlayerURL(myURL) {
player=document.getElementById("MediaPlayer");
player.URL=myURL;
player.controls.play();
}
You might want to call the function above with an onchange event from
a dropdown list (if I read your question right) so let's say each
option element has a value of the URL (path to video eg
option value="http://path/to/your/video.wmv">Video1</option> )
Then on the select element you'd use
select name="blah" id="blah"
onchange="setPlayerURL(this[this.selectedIndex].value)"
one option Video X will play if they choose a different option then Video Y
will play. I'm guess that i will create a play list & the invoke the video
via a play list...but currently I can't even access the WMP object. Do I
need to access these properties all from javascript? Can I access them from
within my webform code?
I don't see how you can do this : If you do a postback then you've
just unloaded the embedded media player object. It's only available on
the client once the page has loaded - I can't see how it can be
available to the server side code.
|
With this part I was thinking something like how i invoke the roll-overs in
my current app... I have this code in my webform code... I really don't know
JavaScript very well so I'm still learning where/when & syntex to use it.
Dim HelpScript As String = "<script language=JavaScript>" &
"function ShowHelp(sVerbiage) {" & "document.Form1.txtHelp.value=sVerbiage;}"
& "</script>"
fldFName.Attributes.Add("onMouseOver", "ShowHelp('Enter your first
name')")
So for example... I have a date field... that if the date is > Value Then
Play X Video, else play Y Video. I think you've already answered my question
though... I should just control it via Javascript.
| Quote: |
Just set the player's <param name="url" value="blah.wmv" /> when the
page is created, that should take care of it.
Cheers - Neil
|
|
|
| Back to top |
|
 |
|
|
|
|