Written yesterdayProgramEmbedded players are required to play the video files on the server. I originally wanted to use the hyperlinkfield sub-control provided by the gridview control. However, after several experiments, I found that this sub-control cannot call the player. I can only call webpages and files.
For example
Http://www.cnblogs.com/liulanglang/archive/2007/06/16/785411.html
Property settings:
1. Call the files in the folder on the server.
Datanavigateurlfields = "lunwbt"
Datanavigateurlformatstring = "files/program 02.16.doc"
Files is the folder where files are placed on the server. {0} is the parameter lunwbt.
2. Call web pages
Datanavigateurlfields = "lunwbh"
Datanavigateurlformatstring = "pinglxx. aspx? Lunwbh = {0 }"
Pinglxx. aspx calls the webpage, and lunwbh needs to pass the Parameter
Finally, we decided to use the Player Plug-in for implementation.
The procedure is as follows:
1. The video files are stored in the info folder on the server.
2. Place the Player Plug-in on the webpage
In HTML Code The player code is as follows:
<Object class = "object" id = "raocx" Height = "385" width = "100%" classid = "CLSID: CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" viewastext>
<Param name = "_ extentx" value = "8467">
<Param name = "_ extenty" value = "8467">
<Param name = "autostart" value = "true">
<Param name = "Shuffle" value = "0">
<Param name = "prefetch" value = "0">
<Param name = "nolabels" value = "0">
<Param name = "src" value = "<% = URL %>">
<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">
</Object>
Note that when the video file is marked in red, the parameters are received from the backend and the video file path is obtained.
3. Background code
Get URL. In this example, a button control is added to the gridview control to obtain the video resource name through the rowcommand method. Note that the resource name is stored in the database table and contains the suffix of the video file. The video Resource Name is bound to the gridview control. Use rowcommand on the gridview control. As follows:
Protected void gridview1_rowcommand (Object sender, gridviewcommandeventargs E)
{
Int indexs = convert. toint32 (E. commandargument. tostring (). Trim ());
Name = convert. tostring (gridview1.rows [indexs]. cells [6]. Text); // obtain the Resource Name
Url = "info \" + name;
}
The above are the basic operation steps!
In the following article Article Some player code is reproduced in
Http://www.cnblogs.com/liulanglang/archive/2007/11/29/976638.html
For reference!
Can you leave a message for other siblings! Great advice!