Web page Video Player program code general code

Source: Internet
Author: User
Tags object end prefetch shuffle

In the client to do a program, suddenly encountered a problem, that is, product page users submit video playback files, how to submit the site in accordance with the video format of the correct playback it .... Depressed for a while, think good idea, say hands on the hands ...

The idea is to get the type of file first and choose a different Web player code based on the type. Three, five, two. At the same time, for the reuse of the code in the future, write a universal call function. Convenient to call in other systems later.

Now publish the source code as follows:

The following are the referenced contents:
Sub Selplay (strurl,strwidth,strheight)
Dim Exts,isext
If strurl <> "" Then
Isext = LCase (Mid (Strurl,instrrev (strURL, ".") +1))
Else
Isext = ""
End If
exts = "Avi,wmv,asf,mov,rm,ra,ram"
If Instr (exts,isext) =0 Then
Response.Write "Illegal video files"
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 Mode:

The following are the referenced contents:
Call Selplay (dvurl,280,220)

This paper collects and collates from the Internet, if you are the original author, please write a letter to change the author and the source post#chinaz.com (change # to @)



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.