The idea is to first obtain the file type and select different webpage player codes according to the type .. 3, 5, go, 2 ..... at the same time, in order to reuse the code in the future, a general call function is written. facilitate future calls in other systems ..
The source code is as follows:
Copy codeThe Code is as follows: Sub SelPlay (strUrl, strWidth, StrHeight)
Dim Exts, isExt
If strUrl <> "" Then
IsExt = LCase (Mid (strUrl, limit Rev (strUrl, ".") + 1 ))
Else
IsExt = ""
End If
Exts = "avi, wmv, asf, mov, rm, ra, ram"
If Instr (Exts, isExt) = 0 Then
Response. write "illegal video file"
Else
Select Case isExt
Case "avi", "wmv", "asf", "mov"
Response. write "<EMBED id = MediaPlayer src =" & strUrl & "width =" & strWidth & "height =" & strHeight & "loop =" "false" "autostart =" "true """> </EMBED>"
Case "mov", "rm", "ra", "ram"
Response. Write "<OBJECT height =" & strHeight & "width =" & strWidth & "classid = clsid: CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA>"
Response. Write "<param name =" "_ ExtentX" "VALUE =" 12700 ">"
Response. Write "<param name =" "_ ExtentY" "VALUE =" 9525 ">"
Response. Write "<param name =" "AUTOSTART" "VALUE =" "-1" ">"
Response. Write "<param name =" "SHUFFLE" "VALUE =" 0 ">"
Response. Write "<param name =" "PREFETCH" "VALUE =" "0">"
Response. Write "<param name =" "NOLABELS" "VALUE =" 0 ">"
Response. Write "<param name =" "SRC" "VALUE =" & strUrl & "">"
Response. Write "<param name =" "CONTROLS" "VALUE =" "ImageWindow">"
Response. Write "<param name =" "CONSOLE" "VALUE =" "Clip">"
Response. Write "<param name =" "LOOP" "VALUE =" 0 ">"
Response. Write "<param name =" "NUMLOOP" "VALUE =" 0 ">"
Response. Write "<param name =" "CENTER" "VALUE =" 0 ">"
Response. Write "<param name =" "MAINTAINASPECT" "VALUE =" 0 ">"
Response. Write "<param name =" "BACKGROUNDCOLOR" "VALUE =" "#000000" ">"
Response. Write "</OBJECT>"
Response. Write "<BR>"
Response. Write "<OBJECT height = 32 width =" & strWidth & "classid = clsid: CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA>"
Response. Write "<param name =" "_ ExtentX" "VALUE =" 12700 ">"
Response. Write "<param name =" "_ ExtentY" "VALUE =" 847 ">"
Response. Write "<param name =" "AUTOSTART" "VALUE =" 0 ">"
Response. Write "<param name =" "SHUFFLE" "VALUE =" 0 ">"
Response. Write "<param name =" "PREFETCH" "VALUE =" "0">"
Response. Write "<param name =" "NOLABELS" "VALUE =" 0 ">"
Response. Write "<param name =" "CONTROLS" "VALUE =" "ControlPanel, StatusBar">"
Response. Write "<param name =" "CONSOLE" "VALUE =" "Clip">"
Response. Write "<param name =" "LOOP" "VALUE =" 0 ">"
Response. Write "<param name =" "NUMLOOP" "VALUE =" 0 ">"
Response. Write "<param name =" "CENTER" "VALUE =" 0 ">"
Response. Write "<param name =" "MAINTAINASPECT" "VALUE =" 0 ">"
Response. Write "<param name =" "BACKGROUNDCOLOR" "VALUE =" "#000000" ">"
Response. Write "</OBJECT>"
End Select
End If
End Sub
Call method:Copy codeThe Code is as follows: Call SelPlay (DvUrl, 280,220)
In fact, the code is better. For some good source code of online players, you can refer to video playback systems such as Max.