Accessing HTML embeded objects with Internet Explorer ActiveX...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,
I'm using .NET v1.1 and the scenario I have is as follows...

I have IE as an ActiveX control embedded in may C# App.
I generate a HTML file dynamically and within the HTML file I embed a
Flash, powerpoint presentation or movie file similar to ...
<object id="globalnav-object"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
width="756" height="88">
<param name="movie"
value="/swf/globalnav/globalnav_en_us.swf?fpReqMinor=79" />
<param name="FlashVars"
value="loc=en_US&htmlApp=false&gatewayURL=gwurl" />
<param name="bgcolor" value="#c6cfd0" />
<param name="menu" value="false" />

<param name="quality" value="high" />
<param name="salign" value="tl" />
<param name="scale" value="noscale" />
<embed id="globalnav-embed"
src="/swf/globalnav/globalnav_en_us.swf?fpReqMinor=79"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
flashvars="loc=en_US&htmlApp=false&gatewayURL=gwurl" bgcolor="#c6cfd0"
menu="false" quality="high" salign="tl" scale="noscale" width="756"
height="88"></embed>
</object>

I then save this HTML file to the HD and then get my C# embeded IE
browser to navigate to the new HTML file to display it to the user.
This is all fine and working.

From my C# App, how can I know when the user has pressed play on
either the Flash or MediaPlayer movie and also how can I tell when the
movie has finished playing, either by the user pressing Stop or if the
movie reaches the end?

I would like to be able to generate two C# events, one which is
fired when the Flash/Movie in the HTML file starts and also one when it
finishs. Is this possible and if so how? Would MSHTML be usefull for this,
again if so how?

Any links/advice/example code appreciated.
 
Dominique,

That's going to be hard to do. You will have to find out which object
it is exactly (using the class id, most likely), and then find out the
specific events based on that.

I would recommend standardizing the format and the player you are going
to use, this way, you can be sure to detect when the movie ends (instead of
trying to determine this from arbitrary players).

Hope this helps.
 
Hi Nicholas,
Thanks for your reply. Are you suggesting I use MSHTML or some other
method?
I quite new to this whole embed IE thing, so need a little bit more direction.

Thanks.

Nicholas Paldino said:
Dominique,

That's going to be hard to do. You will have to find out which object
it is exactly (using the class id, most likely), and then find out the
specific events based on that.

I would recommend standardizing the format and the player you are going
to use, this way, you can be sure to detect when the movie ends (instead of
trying to determine this from arbitrary players).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Dominique said:
Hi all,
I'm using .NET v1.1 and the scenario I have is as follows...

I have IE as an ActiveX control embedded in may C# App.
I generate a HTML file dynamically and within the HTML file I embed a
Flash, powerpoint presentation or movie file similar to ...
<object id="globalnav-object"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
width="756" height="88">
<param name="movie"
value="/swf/globalnav/globalnav_en_us.swf?fpReqMinor=79" />
<param name="FlashVars"
value="loc=en_US&htmlApp=false&gatewayURL=gwurl" />
<param name="bgcolor" value="#c6cfd0" />
<param name="menu" value="false" />

<param name="quality" value="high" />
<param name="salign" value="tl" />
<param name="scale" value="noscale" />
<embed id="globalnav-embed"
src="/swf/globalnav/globalnav_en_us.swf?fpReqMinor=79"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
flashvars="loc=en_US&htmlApp=false&gatewayURL=gwurl" bgcolor="#c6cfd0"
menu="false" quality="high" salign="tl" scale="noscale" width="756"
height="88"></embed>
</object>

I then save this HTML file to the HD and then get my C# embeded IE
browser to navigate to the new HTML file to display it to the user.
This is all fine and working.

From my C# App, how can I know when the user has pressed play on
either the Flash or MediaPlayer movie and also how can I tell when the
movie has finished playing, either by the user pressing Stop or if the
movie reaches the end?

I would like to be able to generate two C# events, one which is
fired when the Flash/Movie in the HTML file starts and also one when it
finishs. Is this possible and if so how? Would MSHTML be usefull for this,
again if so how?

Any links/advice/example code appreciated.
 
Dominique,

No, I'm recommending that in your page you standardize the movie format,
so that the player is always the same. Different formats are going to use
different players, and getting notification that a movie stopped for all of
them is going to be a pain.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Dominique said:
Hi Nicholas,
Thanks for your reply. Are you suggesting I use MSHTML or some other
method?
I quite new to this whole embed IE thing, so need a little bit more
direction.

Thanks.

Nicholas Paldino said:
Dominique,

That's going to be hard to do. You will have to find out which
object
it is exactly (using the class id, most likely), and then find out the
specific events based on that.

I would recommend standardizing the format and the player you are
going
to use, this way, you can be sure to detect when the movie ends (instead
of
trying to determine this from arbitrary players).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Dominique said:
Hi all,
I'm using .NET v1.1 and the scenario I have is as follows...

I have IE as an ActiveX control embedded in may C# App.
I generate a HTML file dynamically and within the HTML file I embed a
Flash, powerpoint presentation or movie file similar to ...
<object id="globalnav-object"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
width="756" height="88">
<param name="movie"
value="/swf/globalnav/globalnav_en_us.swf?fpReqMinor=79" />
<param name="FlashVars"
value="loc=en_US&htmlApp=false&gatewayURL=gwurl" />
<param name="bgcolor" value="#c6cfd0" />
<param name="menu" value="false" />

<param name="quality" value="high" />
<param name="salign" value="tl" />
<param name="scale" value="noscale" />
<embed id="globalnav-embed"
src="/swf/globalnav/globalnav_en_us.swf?fpReqMinor=79"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
flashvars="loc=en_US&htmlApp=false&gatewayURL=gwurl" bgcolor="#c6cfd0"
menu="false" quality="high" salign="tl" scale="noscale" width="756"
height="88"></embed>
</object>

I then save this HTML file to the HD and then get my C# embeded IE
browser to navigate to the new HTML file to display it to the user.
This is all fine and working.

From my C# App, how can I know when the user has pressed play on
either the Flash or MediaPlayer movie and also how can I tell when the
movie has finished playing, either by the user pressing Stop or if the
movie reaches the end?

I would like to be able to generate two C# events, one which is
fired when the Flash/Movie in the HTML file starts and also one when it
finishs. Is this possible and if so how? Would MSHTML be usefull for
this,
again if so how?

Any links/advice/example code appreciated.
 
Nicholas,
Since I am controlling how the HTML is generated, I also know what file (
flash, wmv etc ) is being embeded into the HTML file. Thus I thought of
having different HTML templates for the formats I plan to support ( Flash,
wmv, mov etc ). Since I will know the file extention I should be able to
create separte code paths which are specific for each file format. I plan to
create an abstract MediaPlayer class and then have wrappers for each format's
play, stop and finish, but the problem I have is actually hooking into the
Flash, Media Player or QuickTime respective events.

Or am I missing the point?

Thanks.


Nicholas Paldino said:
Dominique,

No, I'm recommending that in your page you standardize the movie format,
so that the player is always the same. Different formats are going to use
different players, and getting notification that a movie stopped for all of
them is going to be a pain.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Dominique said:
Hi Nicholas,
Thanks for your reply. Are you suggesting I use MSHTML or some other
method?
I quite new to this whole embed IE thing, so need a little bit more
direction.

Thanks.

Nicholas Paldino said:
Dominique,

That's going to be hard to do. You will have to find out which
object
it is exactly (using the class id, most likely), and then find out the
specific events based on that.

I would recommend standardizing the format and the player you are
going
to use, this way, you can be sure to detect when the movie ends (instead
of
trying to determine this from arbitrary players).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi all,
I'm using .NET v1.1 and the scenario I have is as follows...

I have IE as an ActiveX control embedded in may C# App.
I generate a HTML file dynamically and within the HTML file I embed a
Flash, powerpoint presentation or movie file similar to ...
<object id="globalnav-object"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
width="756" height="88">
<param name="movie"
value="/swf/globalnav/globalnav_en_us.swf?fpReqMinor=79" />
<param name="FlashVars"
value="loc=en_US&htmlApp=false&gatewayURL=gwurl" />
<param name="bgcolor" value="#c6cfd0" />
<param name="menu" value="false" />

<param name="quality" value="high" />
<param name="salign" value="tl" />
<param name="scale" value="noscale" />
<embed id="globalnav-embed"
src="/swf/globalnav/globalnav_en_us.swf?fpReqMinor=79"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
flashvars="loc=en_US&htmlApp=false&gatewayURL=gwurl" bgcolor="#c6cfd0"
menu="false" quality="high" salign="tl" scale="noscale" width="756"
height="88"></embed>
</object>

I then save this HTML file to the HD and then get my C# embeded IE
browser to navigate to the new HTML file to display it to the user.
This is all fine and working.

From my C# App, how can I know when the user has pressed play on
either the Flash or MediaPlayer movie and also how can I tell when the
movie has finished playing, either by the user pressing Stop or if the
movie reaches the end?

I would like to be able to generate two C# events, one which is
fired when the Flash/Movie in the HTML file starts and also one when it
finishs. Is this possible and if so how? Would MSHTML be usefull for
this,
again if so how?

Any links/advice/example code appreciated.
 
Dominique,

If you HAD to support all of those formats, then having an abstract
class will be the way you want to go. The thing is, not all of those
players will offer you the event to indicate when the movie is done (it's
not guaranteed they will). What I am saying is convert all the files to
say, an AVI format, and force them to use windows media player embedded in
the page (for example).


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Dominique said:
Nicholas,
Since I am controlling how the HTML is generated, I also know what file (
flash, wmv etc ) is being embeded into the HTML file. Thus I thought of
having different HTML templates for the formats I plan to support ( Flash,
wmv, mov etc ). Since I will know the file extention I should be able to
create separte code paths which are specific for each file format. I plan
to
create an abstract MediaPlayer class and then have wrappers for each
format's
play, stop and finish, but the problem I have is actually hooking into the
Flash, Media Player or QuickTime respective events.

Or am I missing the point?

Thanks.


Nicholas Paldino said:
Dominique,

No, I'm recommending that in your page you standardize the movie
format,
so that the player is always the same. Different formats are going to
use
different players, and getting notification that a movie stopped for all
of
them is going to be a pain.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Dominique said:
Hi Nicholas,
Thanks for your reply. Are you suggesting I use MSHTML or some other
method?
I quite new to this whole embed IE thing, so need a little bit more
direction.

Thanks.

:

Dominique,

That's going to be hard to do. You will have to find out which
object
it is exactly (using the class id, most likely), and then find out the
specific events based on that.

I would recommend standardizing the format and the player you are
going
to use, this way, you can be sure to detect when the movie ends
(instead
of
trying to determine this from arbitrary players).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi all,
I'm using .NET v1.1 and the scenario I have is as follows...

I have IE as an ActiveX control embedded in may C# App.
I generate a HTML file dynamically and within the HTML file I embed
a
Flash, powerpoint presentation or movie file similar to ...
<object id="globalnav-object"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
width="756" height="88">
<param name="movie"
value="/swf/globalnav/globalnav_en_us.swf?fpReqMinor=79" />
<param name="FlashVars"
value="loc=en_US&htmlApp=false&gatewayURL=gwurl" />
<param name="bgcolor" value="#c6cfd0" />
<param name="menu" value="false" />

<param name="quality" value="high" />
<param name="salign" value="tl" />
<param name="scale" value="noscale" />
<embed id="globalnav-embed"
src="/swf/globalnav/globalnav_en_us.swf?fpReqMinor=79"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
flashvars="loc=en_US&htmlApp=false&gatewayURL=gwurl"
bgcolor="#c6cfd0"
menu="false" quality="high" salign="tl" scale="noscale" width="756"
height="88"></embed>
</object>

I then save this HTML file to the HD and then get my C# embeded IE
browser to navigate to the new HTML file to display it to the user.
This is all fine and working.

From my C# App, how can I know when the user has pressed play on
either the Flash or MediaPlayer movie and also how can I tell when
the
movie has finished playing, either by the user pressing Stop or if
the
movie reaches the end?

I would like to be able to generate two C# events, one which is
fired when the Flash/Movie in the HTML file starts and also one when
it
finishs. Is this possible and if so how? Would MSHTML be usefull for
this,
again if so how?

Any links/advice/example code appreciated.
 
Hi Nicholas,
I finally understand what you. thanks for the clarification.
If I could standardise on MediaPlayer, how could I hook into it's events
from within IE?

Thanks.

Nicholas Paldino said:
Dominique,

If you HAD to support all of those formats, then having an abstract
class will be the way you want to go. The thing is, not all of those
players will offer you the event to indicate when the movie is done (it's
not guaranteed they will). What I am saying is convert all the files to
say, an AVI format, and force them to use windows media player embedded in
the page (for example).


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Dominique said:
Nicholas,
Since I am controlling how the HTML is generated, I also know what file (
flash, wmv etc ) is being embeded into the HTML file. Thus I thought of
having different HTML templates for the formats I plan to support ( Flash,
wmv, mov etc ). Since I will know the file extention I should be able to
create separte code paths which are specific for each file format. I plan
to
create an abstract MediaPlayer class and then have wrappers for each
format's
play, stop and finish, but the problem I have is actually hooking into the
Flash, Media Player or QuickTime respective events.

Or am I missing the point?

Thanks.


Nicholas Paldino said:
Dominique,

No, I'm recommending that in your page you standardize the movie
format,
so that the player is always the same. Different formats are going to
use
different players, and getting notification that a movie stopped for all
of
them is going to be a pain.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi Nicholas,
Thanks for your reply. Are you suggesting I use MSHTML or some other
method?
I quite new to this whole embed IE thing, so need a little bit more
direction.

Thanks.

:

Dominique,

That's going to be hard to do. You will have to find out which
object
it is exactly (using the class id, most likely), and then find out the
specific events based on that.

I would recommend standardizing the format and the player you are
going
to use, this way, you can be sure to detect when the movie ends
(instead
of
trying to determine this from arbitrary players).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi all,
I'm using .NET v1.1 and the scenario I have is as follows...

I have IE as an ActiveX control embedded in may C# App.
I generate a HTML file dynamically and within the HTML file I embed
a
Flash, powerpoint presentation or movie file similar to ...
<object id="globalnav-object"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
width="756" height="88">
<param name="movie"
value="/swf/globalnav/globalnav_en_us.swf?fpReqMinor=79" />
<param name="FlashVars"
value="loc=en_US&htmlApp=false&gatewayURL=gwurl" />
<param name="bgcolor" value="#c6cfd0" />
<param name="menu" value="false" />

<param name="quality" value="high" />
<param name="salign" value="tl" />
<param name="scale" value="noscale" />
<embed id="globalnav-embed"
src="/swf/globalnav/globalnav_en_us.swf?fpReqMinor=79"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
flashvars="loc=en_US&htmlApp=false&gatewayURL=gwurl"
bgcolor="#c6cfd0"
menu="false" quality="high" salign="tl" scale="noscale" width="756"
height="88"></embed>
</object>

I then save this HTML file to the HD and then get my C# embeded IE
browser to navigate to the new HTML file to display it to the user.
This is all fine and working.

From my C# App, how can I know when the user has pressed play on
either the Flash or MediaPlayer movie and also how can I tell when
the
movie has finished playing, either by the user pressing Stop or if
the
movie reaches the end?

I would like to be able to generate two C# events, one which is
fired when the Flash/Movie in the HTML file starts and also one when
it
finishs. Is this possible and if so how? Would MSHTML be usefull for
this,
again if so how?

Any links/advice/example code appreciated.
 
Back
Top