Go Back   CodingForums.com > :: Client side development > Graphics and Multimedia discussions

Before you post, read our: Rules & Posting Guidelines

Closed Thread
 
Thread Tools Rating: Thread Rating: 31 votes, 3.42 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-13-2008, 05:17 AM   PM User | #706
ntoo
New to the CF scene

 
Join Date: Apr 2008
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
ntoo is an unknown quantity at this point
Quote:
Originally Posted by AffectiontoDeta View Post
Hi, thanks for that. Will try it and see if it helps although it tends to go on about IE issues rather than Firefox and I feel its FF that is the issue at this point in time rather than my poor coding
That whole area of msdn is about the windows media player. There are around 20 pages with info specifically for Firefox. eg:-
http://msdn2.microsoft.com/en-us/lib...15(VS.85).aspx

That page is called "Using the Windows Media Player Control with Firefox". Can't get much more Firefox oriented than that There are at least 20 pages in the wmp area that have information on how to do things with wmp in Firefox.

As to your hide the controls issue, I had a quick go with the application/x-mplayer2 embed and could not remove the controls with either param entries or script in Firefox 2 or Safari doing what MS recommends for Netscape4+ (using the mplayer2 plugin).

However, using application/x-ms-wmp :-

<html>
<head>
<script type="text/javascript">
<!--
function doObjTag(){
navigator.userAgent.indexOf("MSIE") != -1 ? document.write('<object id="MediaPlayer" width="320" height="240" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6"/>\n') : document.write('<object type="application/x-ms-wmp" width="320" height="240" id="MediaPlayer" data="Intro Movie.wmv"/>\n');
}
// -->
</script>
</head>

<body>
<div id ="movie">
<div align="center">
<script type="text/javascript">doObjTag()</script>
<param name="url" value="Intro Movie.wmv" />
<param name="uiMode" value="none" />
<param name="PlayCount" value="3"/>
</object>
</div>
</div>
</body>
</html>

There's your (nearly completely) script controllable 320x240 wmp with autostart, 2 replays and no controls for Firefox, Safari and IE5+ in 8 lines of code. I'd bet there are other more efficient ways to do it. Hmmmm... I'm not actually certain that it'll only replay twice coz I didn't leave the .wmv runnin for that long.

Anyway, I'm sure you can adapt that for your AC_AX_RunContent script.

ntoo

Last edited by ntoo; 04-13-2008 at 05:34 AM.. Reason: typos
ntoo is offline  
Old 04-13-2008, 11:57 AM   PM User | #707
AffectiontoDeta
New to the CF scene

 
Join Date: Apr 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
AffectiontoDeta is an unknown quantity at this point
Quote:
Originally Posted by ntoo View Post
That whole area of msdn is about the windows media player. There are around 20 pages with info specifically for Firefox. eg:-
http://msdn2.microsoft.com/en-us/lib...15(VS.85).aspx

That page is called "Using the Windows Media Player Control with Firefox". Can't get much more Firefox oriented than that There are at least 20 pages in the wmp area that have information on how to do things with wmp in Firefox.

As to your hide the controls issue, I had a quick go with the application/x-mplayer2 embed and could not remove the controls with either param entries or script in Firefox 2 or Safari doing what MS recommends for Netscape4+ (using the mplayer2 plugin).

However, using application/x-ms-wmp :-

<html>
<head>
<script type="text/javascript">
<!--
function doObjTag(){
navigator.userAgent.indexOf("MSIE") != -1 ? document.write('<object id="MediaPlayer" width="320" height="240" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6"/>\n') : document.write('<object type="application/x-ms-wmp" width="320" height="240" id="MediaPlayer" data="Intro Movie.wmv"/>\n');
}
// -->
</script>
</head>

<body>
<div id ="movie">
<div align="center">
<script type="text/javascript">doObjTag()</script>
<param name="url" value="Intro Movie.wmv" />
<param name="uiMode" value="none" />
<param name="PlayCount" value="3"/>
</object>
</div>
</div>
</body>
</html>

There's your (nearly completely) script controllable 320x240 wmp with autostart, 2 replays and no controls for Firefox, Safari and IE5+ in 8 lines of code. I'd bet there are other more efficient ways to do it. Hmmmm... I'm not actually certain that it'll only replay twice coz I didn't leave the .wmv runnin for that long.

Anyway, I'm sure you can adapt that for your AC_AX_RunContent script.

ntoo
Hi, thanks for that. I've been playing all morning with other codes and still can't get anything to work. Will give the above ago and report back.
AffectiontoDeta is offline  
Old 04-13-2008, 12:17 PM   PM User | #708
AffectiontoDeta
New to the CF scene

 
Join Date: Apr 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
AffectiontoDeta is an unknown quantity at this point
Hi, I got a bit lost with all the coding so copied some of the coding you suggested into mine. I'm sure it could be trimmed down but for the meantime its working! I couldn't put the function section in the head as its template driven so done it as below:

<div id ="movie">
<div align="center">
<script type="text/javascript">
AC_AX_RunContent( 'id','MediaPlayer','width','320','height','240','align','center','classid','CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6','standby','Loading Windows Media Player components...','type','application/x-ms-wmp','src','Intro Movie.wmv','url','Intro Movie.wmv','uimode','none','playcount','3' ); //end AC code
</script>
<noscript>
<object id="MediaPlayer" width="320" height="240" align="center" classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6"
standby="Loading Windows Media Player components..." type="application/x-ms-wmp">
<param name="url" value="Intro Movie.wmv" />
<param name="uiMode" value="none" />
<param name="PlayCount" value="3"/>
<embed src="Intro Movie.wmv" width="320" height="240" align="center" url="Intro Movie.wmv" uimode="none" playcount="3"></embed>
</object>
</noscript>
</div>
</div>

If it can be cleaned up let me know but thanks for all your help!
AffectiontoDeta is offline  
Old 04-15-2008, 02:15 PM   PM User | #709
alliancejhall
New to the CF scene

 
Join Date: Apr 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
alliancejhall is an unknown quantity at this point
Need help to limit play time....

i'm brand new on this forum and as you can tell this thread is super long so i'm sorry if this has been answered more than once. but basically i want to limit the play time of an embedded wmp to 5 seconds.... here's my code.


pnMediaPlayer.Controls.Add(New LiteralControl("<object id='VIDEO' width='300px' style='height: 60px;' classid = 'CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' type='application/x-oleobject'>" & _
"<param name='URL' value='" & Request.ApplicationPath.TrimEnd("/") & "/Uploads/" & strFileName & "'/>" & _
"<param name='SendPlayStateChangeEvents' value='true'/>" & _
"<param name='AutoStart' value='true'/>" & _
"<param name='SelectionStart' value='0'>" & _
"<param name='SelectionEnd' value='5'>" & _

"<param name='uiMode' value='full'/>" & _
"<param name='PlayCount' value='1'/>" & _
"<param name='stretchToFit' value='true'/>" & _
"<param name='Volume' value='80'/>" & _
"<param name='enableContextMenu' value='false'/>" & _
"<param name='windowlessVideo' value='false'/>" & _
"</object>"))

as you can see by the highlighted area i've tried the selectionstart/end but it doesn't work. is this possible what i'm trying to do?
alliancejhall is offline  
Old 04-16-2008, 09:08 AM   PM User | #710
ntoo
New to the CF scene

 
Join Date: Apr 2008
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
ntoo is an unknown quantity at this point
Limit play time

Hi alliancejhall,

According to
http://msdn2.microsoft.com/en-us/lib...11(VS.85).aspx
SelectionStart and SelectionEnd aren't 'PARAM elements of the object element'. I don't remember seeing SelectionStart or SelectionEnd in the wmp pages.

If it isn't possible to only play a selection you could make 5sec videos or use a script to limit the play time. eg
var wmpID=document.getElementById("VIDEO");
setTimeout("wmpID.controls.stop",5000);
You probably won't want to start the timer until the video starts playing.

ntoo
ntoo is offline  
Old 04-16-2008, 01:33 PM   PM User | #711
alliancejhall
New to the CF scene

 
Join Date: Apr 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
alliancejhall is an unknown quantity at this point
Quote:
Originally Posted by ntoo View Post
Hi alliancejhall,

According to
http://msdn2.microsoft.com/en-us/lib...11(VS.85).aspx
SelectionStart and SelectionEnd aren't 'PARAM elements of the object element'. I don't remember seeing SelectionStart or SelectionEnd in the wmp pages.

If it isn't possible to only play a selection you could make 5sec videos or use a script to limit the play time. eg
var wmpID=document.getElementById("VIDEO");
setTimeout("wmpID.controls.stop",5000);
You probably won't want to start the timer until the video starts playing.

ntoo
Thanks so much ntoo.... that's what i was thinking but i wasn't sure. Also how would i call that function when the video loads? is there an onload or onstart i could put in parameters or in the object tag?
alliancejhall is offline  
Old 04-16-2008, 02:31 PM   PM User | #712
alliancejhall
New to the CF scene

 
Join Date: Apr 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
alliancejhall is an unknown quantity at this point
I've got the script work except at the time oout period i recieve an error that says "Object does not support this property or method"

I'm using your script in javascript i assume that is correct? any ideas?

here's my code:

Dim strScript As StringBuilder = New StringBuilder
strScript.Append("<script language='javascript' type='text/javascript'>")
strScript.Append("var wmpID=document.getElementById('VIDEO');")
strScript.Append("setTimeout('wmpID.controls.stop',5000);")
strScript.Append("</script>")
ScriptManager.RegisterStartupScript(Page, GetType(Page), "TimeOut", strScript.ToString, False)
alliancejhall is offline  
Old 04-16-2008, 04:22 PM   PM User | #713
alliancejhall
New to the CF scene

 
Join Date: Apr 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
alliancejhall is an unknown quantity at this point
Never mind i got it!

Dim strScript As StringBuilder = New StringBuilder
strScript.Append("<script language='javascript' type='text/javascript'>")
strScript.Append("var wmpID=document.getElementById('VIDEO');")
strScript.Append("setTimeout('wmpID.controls.stop()',5000);")
strScript.Append("</script>")
ScriptManager.RegisterStartupScript(Page, GetType(Page), "TimeOut", strScript.ToString, False)


i was missing the parans after wmpID.controls.stop
alliancejhall is offline  
Old 04-16-2008, 05:08 PM   PM User | #714
ntoo
New to the CF scene

 
Join Date: Apr 2008
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
ntoo is an unknown quantity at this point
Hi alliancejhall,

Oops... sorry about that. I forgot to put them in.

Congratulations on 'getting it'

ntoo

Last edited by ntoo; 04-16-2008 at 05:13 PM.. Reason: typos
ntoo is offline  
Old 04-17-2008, 05:45 AM   PM User | #715
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,292
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Another IE only script out there now...sighs.
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline  
Old 04-17-2008, 01:23 PM   PM User | #716
ntoo
New to the CF scene

 
Join Date: Apr 2008
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
ntoo is an unknown quantity at this point
Quote:
Originally Posted by _Aerospace_Eng_ View Post
Another IE only script out there now...sighs.
hmmm Aerospace...

If the page uses windows media player to play the media, what's the harm in the viewers being limited to IE?

ntoo
ntoo is offline  
Old 04-17-2008, 04:36 PM   PM User | #717
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,292
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Because there are browsers out that do support the windows media player eg firefox, it just doesn't support the activex features of windows media player. I don't even think it supports the script that the user was using in their post. When developing a website for the internet its best to make sure your code is cross-browser yet you have the beginners who want a 'cool' looking site yet they have no idea how much of what they have done will only work in IE.
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline  
Old 04-17-2008, 06:24 PM   PM User | #718
ntoo
New to the CF scene

 
Join Date: Apr 2008
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
ntoo is an unknown quantity at this point
Yep absolutely. It's best to write the page for all browsers if you want it to be 'cool' for everyone. Imo that means no wmp.

On a side note... In my recent experience it wasn't beginners who wanted the page to only work in IE. I didn't argue (much) with the person who signed the cheque. Just did what they wanted

ntoo
ntoo is offline  
Old 04-29-2008, 06:18 AM   PM User | #719
lse123
Regular Coder

 
Join Date: Dec 2005
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
lse123 is infamous around these parts
this you say is for wmp ? what about qt ?
lse123 is offline  
Old 04-29-2008, 02:06 PM   PM User | #720
ntoo
New to the CF scene

 
Join Date: Apr 2008
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
ntoo is an unknown quantity at this point
Quote:
Originally Posted by lse123 View Post
this you say is for wmp ? what about qt ?
I wouldn't put QT in a page.

I don't think it's nice to risk altering someones startup settings (ie changing their registry) because they viewed a webpage. Same goes for Real.

Or am I misunderstanding your question?

ntoo
ntoo is offline  
Closed Thread

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:41 PM.


Advertisement
Log in to turn off these ads.