Use Helix Server's SMIL support to generate media streams in ASP

xiaoxiao2021-03-06  90

When developing a video on demand website, you may need to play a series of streaming media files in a row, and my experience is that you can use the SMIL language to dynamically generate a needed playlist file. This method will be described below. I feel that this is not a good way, but it can be used as a kind of idea for your reference.

First we should learn about the SMIL language structure. SMIL is a language dedicated to streaming media servers, which is in line with XML language specification. The following is a typical SMIL file for Helix Server:

113.SMI -------------- < / par>

Title refers to the title of the top of the RealPlayer player player. Author, Copyright is version information, which can be seen when you click RealPlayer to run the hocker. In in , SCR refers to the location of streaming media files, and title means that this media is displayed in the playlist. Each defines a file so that the continuous play of the media stream is realized. Use this approach to easily add an ad or custom film end to media files in our website. I know that the file structure is left. However, pay attention to the character to filter characters before generating SMI files because some characters in XML cannot appear freely.

Code example:

Several custom functions are not introduced (getExtName is the acquisition file extension)

xRMExtNames = "rm, ram, rmvb, mp3, mpeg, mpa" rmPlayList = "smil / a.smi" Sub WritePlayListRM dim strTmpSrc, sql Set fso = CreateObject ( "Scripting.FileSystemObject") Set tf = fso.CreateTextFile (server. Mappath (RMPLAYLIST), TRUE) Tf.writeline ("") Tf.Writeline ("") Tf.Writeline ("") Tf.writeline ("") Tf.Writeline (") TF.writeline (" ") TF.writeline (" ") set rsserver = Server.createObject ("AdoDb.Recordset") Do While NOT RS.EOF IF INSTR (XRMextNames, Lcase (GetExtName (RS ("FileName")))> 0 Then SQL = "Select * from site_servers where uid =" RS ("ServerID") RSServer.open SQL, CONN, 1, 1 STRTMPSRC = RSSERVER ("FileName") Tf.Writeline ("") Tf.Writeline ("< REF SRC = "& CHR (34) & Strtmpsrc & Chr (34) &" Title = "& Chr (34) & XMLFilter (RS (" Title ") & chr (34) &" /> ") TF.writeline ("") rsserver.close rmnum = rmnum 1 end if =

/ body> ") Tf.Writeline (" ") TF.Close set tr = nothing set rsserver = Nothingend Subfunction XMLFILTER (STRINPUT) XMLFilter = Replace (Strinput," <"," (") XMLFilter = Replace XMLFilter, ">", ")") XMLFilter = Replace (XMLFilter, Chr (34), ") XMLFilter = Replace (XMLFilter," '",") End Function This is my method, welcome everyone to criticize.

转载请注明原文地址:https://www.9cbs.com/read-123275.html

New Post(0)