Testtv. jsp (common, supporting RM, rmvb, ASF, SwF, WMV, poor. Avi playback light has sound and no images. If anyone can solve this problem, contact me. Thank you !!)
<% @ Page contenttype = "text/html; charset = gb2312" Import = "Java. util. *" %>
<% @ Page import = "My. Bean. *" %>
<% @ Page import = "com. pp. DB. dboperate" %>
<% @ Page import = "com. jetsum. Manager. *" %>
<JSP: Directive. Page import = "com. jetsum. util. pubfunc"/>
<%
Int id = pubfunc. parseint (request. getparameter ("ID "));
String hql = "from TV where id =" + ID;
Dboperate DBO = new dboperate ();
DBO. setlength (10 );
List tvlist = new arraylist ();
Tvlist = DBO. findsqlhibernate (hql, 1 );
For (int A = 0; A <tvlist. Size (); A ++ ){
TV mytv = (TV) tvlist. Get ();
%>
<HTML>
<Head>
<Title> <% = mytv. GETID () %> </title>
<Meta name = "generator" content = "Microsoft FrontPage 5.0">
<Meta name = "progid" content = "FrontPage. Editor. Document">
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Style>
A {
Font-size: 9pt;
Color: FFFF00;
Text-Decoration: none;
}
A: hover {color: red; text-Decoration: none ;}
TD {font-size: 9pt; color: # ffffcc}
</Style>
</Head>
<Body bgcolor = "#000000" topmargin = "0" leftmargin = "0" rightmargin = "0" scroll = NO>
<% IF (mytv. getpic (). Equals ("RM") | mytv. getpic (). Equals ("rmvb ")){
%>
<Object ID = video1 classid = "CLSID: CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" Height = 288 width = 352>
<Param name = "_ extentx" value = "9313">
<Param name = "_ extenty" value = "7620">
<Param name = "autostart" value = "1">
<Param name = "Shuffle" value = "0">
<Param name = "prefetch" value = "0">
<Param name = "nolabels" value = "0">
<Param name = "src" value = "<% = mytv. geturl () %>">
<Param name = "controls" value = "imagewindow">
<Param name = "console" value = "clip1">
<Param name = "loop" value = "0">
<Param name = "numloop" value = "0">
<Param name = "center" value = "0">
<Param name = "maintainaspect" value = "0">
<Param name = "backgroundcolor" value = "#000000"> <embed SRC type = "audio/X-PN-RealAudio-plugin" console = "clip1" controls = "imagewindow" height = "288" width = "352" autostart = "false">
</Object>
<%
}
Else if (mytv. getpic (). Equals ("ASF ")){
%>
<Object classid = CLSID: 22d6f312-b0f6-11d0-94ab-0080c74c7e95 codebase = "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,1,5,217"
Id = mediaplayer type = application/X-oleobject width = 210 Height = 200 standby = "loading Microsoft Windows Media Player components..." viewastext align = middle>
<Param name = audiostream value =-1>
<Param name = autosize value = 0>
<Param name = autostart value = 1>
<Param name = animationatstart value = 0>
<Param name = allowscan value =-1>
<Param name = allowchangedisplaysize value = 0>
<Param name = autorewind value = 0>
<Param name = balance value = 0>
<Param name = baseurl value = "">
<Param name = bufferingtime value = 5>
<Param name = captioningid value = "">
<Param name = clicktoplay value = 0>
& Lt; Param name = cursortype value = 32512 & gt;
<Param name = currentposition value =-1>
<Param name = currentmarker value = 0>
<Param name = defaultframe value = 1>
<Param name = displaybackcolor value = 0>
<Param name = displayforecolor value = 16777215>
<Param name = displaymode value = 0>
<Param name = displaysize value = 0>
<Param name = Enabled value =-1>
<Param name = enablecontextmenu value =-1>
<Param name = enablepositioncontrols value = 0>
<Param name = enablefullscreencontrols value = 0>
<Param name = enabletracker value = 0>
<Param name = filename value = "<% = mytv. geturl () %>">
<Param name = invokeurls value =-1>
<Param name = language value =-1>
<Param name = mute value = 0>
<Param name = playcount value = 0>
<Param name = previewmode value = 0>
<Param name = rate value = 1>
<Param name = samilang value = "">
<Param name = samistyle value = "">
<Param name = samifilename value = "">
<Param name = selectionstart value = 0>
<Param name = selectionend value = true>
<Param name = sendopenstatechangeevents value =-1>
<Param name = sendwarningevents value =-1>
<Param name = senderrorevents value =-1>
<Param name = sendkeyboardevents value = 0>
<Param name = sendmouseclickevents value = 0>
<Param name = sendmousemoveevents value = 0>
<Param name = sendplaystatechangeevents value =-1>
<Param name = showcaptioning value = 0>
<Param name = showcontrols value = 1>
<Param name = showaudiocontrols value = 1>
<Param name = showdisplay value = 0>
<Param name = showgotobar value = 0>
<Param name = showpositioncontrols value = 1>
<Param name = showstatusbar value = 1>
<Param name = showtracker value = 1>
<Param name = transparentatstart value = 0>
<Param name = videoborderwidth value = 0>
<Param name = videobordercolor value = 0>
<Param name = videoborder3d value = 0>
<Param name = volume value = 1000>
<Param name = windowlessvideo value = 1>
</Object>
<%
}
Else if (mytv. getpic (). Equals ("SWF ")){
%>
<Script language = "JavaScript">
Top. Window. moveTo (0, 0 );
If (document. All ){
Top. Window. resizeTo (screen. availwidth, screen. availheight );
}
Else if (document. Layers | document. getelementbyid ){
If (top. Window. outerheight <screen. availheight | top. Window. outerwidth <screen. availwidth ){
Top. Window. outerheight = screen. availheight;
Top. Window. outerwidth = screen. availwidth;
}
}
</SCRIPT>
<Object classid = "CLSID: D27CDB6E-AE6D-11cf-96B8-444553540000" codebase = "http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" width = "100%" Height = "100%"> <Param name = movie value = "<% = mytv. geturl () %> "> <Param name = Quality value = high> <embed src =" <% = mytv. geturl () %> "loop = false menu = false quality = high width =" 100% "Height =" 100% "type =" application/X-Shockwave-flash "pluginspage =" http: // www. Macromedia.com/shockwave/download/index.cgi? P1_prod_version = shockwaveflash "> </embed> </Object>
<%}
Else if (mytv. getpic (). Equals ("WMV ")){
%>
<Object ID = "nsplay" width = 200 Height = 200 classid = "CLSID: 22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase = "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby = "loading Microsoft Windows Media Player components... "type =" application/X-oleobject "align =" Left "hspace =" 5 ">
<Param name = "autorewind" value = 1>
<Param name = "FILENAME" value = "<% = mytv. geturl () %>">
<Param name = "showcontrols" value = "1">
<Param name = "showpositioncontrols" value = "0">
<Param name = "showaudiocontrols" value = "1">
<Param name = "showtracker" value = "1">
<Param name = "showdisplay" value = "0">
<Param name = "showstatusbar" value = "0">
<Param name = "showgotobar" value = "0">
<Param name = "showcaptioning" value = "0">
<Param name = "autostart" value = 1>
<Param name = "volume" value = "500">
<Param name = "animationatstart" value = "0">
<Param name = "transparentatstart" value = "0">
<Param name = "allowchangedisplaysize" value = "0">
<Param name = "allowscan" value = "0">
<Param name = "enablecontextmenu" value = "0">
<Param name = "clicktoplay" value = "1">
</Object>
<%}
} %>
</Body>
</Html>
TV. Java
Package my. Bean;
Public class TV {
Private int ID;
Private string name;
Private string URL;
Private string PIC; // video Extension
Public int GETID (){
Return ID;
}
Public void setid (int id ){
This. ID = ID;
}
Public String getname (){
Return name;
}
Public void setname (string name ){
This. Name = Name;
}
Public String getpic (){
Return PIC;
}
Public void setpic (string pic ){
This. PIC = PIC;
}
Public String geturl (){
Return URL;
}
Public void seturl (string URL ){
This. url = URL;
}
}
TV. HBM. xml
<? XML version = "1.0" encoding = "UTF-8"?>
<! Doctype hibernate-mapping public "-// hibernate/hibernate mapping DTD 3.0 // en"
Http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd>
<! --
Mapping File autogenerated by myeclipse persistence tools
-->
<Hibernate-mapping package = "My. Bean">
<Class
Name = "TV"
Table = "TV"
>
<ID
Name = "ID"
Type = "int"
Column = "ID"
>
<Generator class = "Identity"/>
</ID>
<Property
Name = "name"
Column = "name"
Type = "string"
Not-null = "false"
/>
<Property
Name = "url"
Column = "url"
Type = "string"
Not-null = "false"
/>
<Property
Name = "pic"
Column = "pic"
Type = "string"
Not-null = "false"
/>
</Class>
</Hibernate-mapping>