Html code - Geeks to Go Forums

Jump to content

Log in Register Register Malware removal guide How it works

Html code

#1 hary

  • Group: Member
  • Posts: 94
  • Joined: 27-December 05

Posted 09 February 2008 - 08:53 AM

Can any one suggest the alteration I need to make to this code.

I am trying to stop the video clip playing automatically, but wait until the button is pressed.

It works ok with IE but not Firefox. I need it to work with both.
<embed width=340 height=280 type=application/x-mplayer2 autostart=false src=http://filehouse.fileave.com/simpson2.wmv></embed>


http://filehouse.fil.../practice2.html

Thankyou

#2 Ax238

  • Group: Technician
  • Posts: 1,319
  • Joined: 09-November 07

Posted 09 February 2008 - 02:39 PM

Hello hary,

The <embed> tag has been deprecated. It would be better in the long run to use the <object> tag. You can then set up a parameter to keep the movie from autostarting:
<param name="autoStart" value="False">

See the following for more detailed setup information:
Embedding Windows Media Player WMV

Regards,

Ax

#3 Major Payne

  • Group: Retired Staff
  • Posts: 5,307
  • Joined: 26-January 05

Posted 09 February 2008 - 02:57 PM

Actually, the embed tag is still needed for some browsers unless you use the complicated Satay Method.

You might want to set up your code using this simple code generator:

Embedded Media HTML Generator

You can get your code to validate with the embed tag, if you care about validation, by using JavaScript and its inherent problems with browsers that have JS turned off.

Ron

#4 Ax238

  • Group: Technician
  • Posts: 1,319
  • Joined: 09-November 07

Posted 09 February 2008 - 03:25 PM

Hmmm, the Satay method seems to be used for flash, whereas the user is requesting assistance with embedding a WMV file.

As for support:
<embed /> Web Browser Support:
Netscape
Mozilla
Firefox
Internet Explorer
Opera
Safari
WebTV / MSNTV

<object> Web Browser Support:
Netscape
Mozilla
Firefox
Internet Explorer
Opera
Safari
XHTML 1.0: XHTML Client-Side Image Map Module, XHTML Object Module

Looks like pretty good support across the board.

The following should work, seems easy enough as well:
<object id='player' classid='CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6' type='application/x-oleobject'>
<param name='FileName' value='URL TO WMV FILE' />
<param name="autoStart" value="False">
</object>


You won't need to use javascript at all with this method.

#5 Major Payne

  • Group: Retired Staff
  • Posts: 5,307
  • Joined: 26-January 05

Posted 09 February 2008 - 03:35 PM

If you know what you're doing, you can adopt the methods in Satay for whatever.

Depending on file type, Firefox needs the embed tag, not object tags. The embed code generator is very useful for all types and you can just cut the embed tag out as needed.

Ron

#6 Ax238

  • Group: Technician
  • Posts: 1,319
  • Joined: 09-November 07

Posted 09 February 2008 - 04:55 PM

Nice to have options isn't it? The following code will work in Firefox and IE, as well as other browsers:
		<object id="player" type="video/x-ms-wmv" data="URL TO WMV FILE" width="320" height="260">
			<param name="src" value="URL TO WMV FILE" />
			<param name="autostart" value="false">
			<param name="controller" value="true" />
		</object>

Here's a nice reference page for embedded various media types in the object tag:
http://joliclic.free...ject-video.html

#7 hary

  • Group: Member
  • Posts: 94
  • Joined: 27-December 05

Posted 10 February 2008 - 01:18 PM

Thank you very much for your ideas, I have tried everything and the following seems to

work in Ie/Firefox/Opera. I have kept it simple.

<center><embed src="http://filehouse.fileave.com/simpson2.wmv"autostart="0" 
type="application/x-mplayer2" wmode="transparent" width="340" height="280"></embed></center>


Autostart= 0 rather than = false made a difference.

http://filehouse.fil.../practice2.html

#8 Major Payne

  • Group: Retired Staff
  • Posts: 5,307
  • Joined: 26-January 05

Posted 10 February 2008 - 02:33 PM

View Posthary, on Feb 10 2008, 01:18 PM, said:

Autostart= 0 rather than = false made a difference.
true/false are used with object tags. 1/0 are used with embed tag. BTW, there is no such thing as a closing embed tag (</embed>).

Ron

#9 Ax238

  • Group: Technician
  • Posts: 1,319
  • Joined: 09-November 07

Posted 11 February 2008 - 09:31 AM

:) Glad you got it to work out :)

Share this topic: