How Delphi inserts Html/java script code in WebBrowser
Assign the following code to 1 notebooks to save, then save as xxx.htm to see the effect
implementing features with Pastehtml
of events
- Windows Media Player mp3 mp4
- Windows Real Player
- Flash Player
- Mid background music
- Image
The method
( (WebBrowser1.Document as IHTMLDocument2).selection.createRange as IHtmlTxtRange).pasteHTML(Memo1.Text);
注意 划删除线的表示使用这个函数无效果
Play mid background music SRC is a MIDI file name, Loop=-1 for infinite playback, 1 for once, 2 for two times ...
<HTML><HEAD>
<bgsound src=C:\1.mid loop=-1</HEAD>
<body></body></HTML>
Windows Media Player supports playback *.mp3 *.avi *.mp4 *.mov *.wmv *.wav *.mid *.wma *.m3u *.mpeg *.csf *.asf *.3gp
<object style="WIDTH: 480px; HEIGHT: 360px" ID="nsPlayer" classid="clsid:05589FA1-C356-11CE-BF01-00AA0055595A">
<PARAM NAME="FileName" VALUE=C:\1.mp3 />
<PARAM NAME="AutoStart" VALUE="1" />
<PARAM NAME="ShowDisplay" VALUE="0" />
</OBJECT>
Windows Media Player support format *.mp4 *.avi not supported. mp3
</ STYLE ;
</ HEAD >< BODY ;
< DIV ;
< EMBED
Width = 400
Height = $
type =application/x-oleobject
codeBase =http://activex.microsoft.com/activex/ Controls / mplayer/en/nsmp2inf.cab#version=5,1,52,701
SRC = File://C:/1.avi
autostart= " False "
flename=" MP ";
</ EMBED ></ EMBED ></ EMBED ;
</ DIV ></ BODY ;
</ HTML ;
//real player
Supported formats *.rm *.avi
<EMBED
height=360
width=480
src="c:\1.avi"
type=audio/x-pn-realaudio-plugin
autostart="False"
controls="ControlPanel">
</embed>
//real player
Supported formats *.rm *.avi
</HEAD><BODY>
<EMBED
width=480
height=360
type=audio/x-pn-realaudio-plugin
src="C:\1.avi"
autostart="true"
console="cons"
controls="ImageWindow">
</EMBED>
</BODY></HTML>
Insert Flash Player <
Object
ClassID= "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase= "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
width= "480"
Height= "360"
title= "Saxs" >
<
param
name= "movie"
value= "c:\1.swf"/>
<
param
name= "Play"
value= "false"/>
<
param
name= "Quality"
value= "High"/>
<
param
name= "allowScriptAccess"
value= "Always"/>
<
param
name= "allowFullScreen"
value= "true"/>
</
Object>
From for notes (Wiz)