This is the last of three articles in this series, in the first two articles, introduced the development of Hai Kang Monitoring scheme and the implementation of the relay server, this article describes the web side of the function implementation, after the project development in this article, we have achieved the original project requirements. The official Player SDK is required for the project, please download the corresponding version according to the project needs. First, the author will take you step-by-step to achieve the development of client plug-ins.
Player development:
According to Haikang's official SDK, the player we're going to do is simply introduce the Haikang player into our own project, and then receive data from the staging server, which is then displayed to the customer's Web browser. In fact, the whole is an introduction of the sea-Kang Play Library ActiveX plug-in development. Following the development process step-by-step implementation of the player plug-in development.
New C # class library project
To introduce files from the Player SDK into your project
Add a WinForm user control to a project
New Setup Project
Publish Project
Digital signatures
Publish a Web site
About the C # Development of ActiveX detailed process, the garden has a lot of articles written in very detailed, I am not here, I am not very familiar with friends, I recommend here a more detailed article "asp.net C # ActiveX code in C # to write ActiveX control." This article writes the core function of the player plug-in.
First, look at the contents of the SDK's C # call:
public class Playctrlsdk {#region decoding library [DllImport ("PlayCtrl.dll")] public static Exte
RN UINT Playm4_getlasterror (int nport);
[DllImport ("PlayCtrl.dll")] public static extern int playm4_getcaps (); <summary>///Get unused channel number///</summary>///<param name= "Nport" ></pa Ram>///<returns></returns> [DllImport ("PlayCtrl.dll")] public static extern
BOOL Playm4_getport (ref int nport); <summary>///Set streaming playback mode///</summary>///<param name= "Port" ></param >///<param name= "mode" ></param>///<returns></returns> [dllimp
ORT ("PlayCtrl.dll")] public static extern bool Playm4_setstreamopenmode (int nport, int mode); <summary>///Open stream///</summary>///<pAram Name= "Nport" ></param>///<param name= "pfileheadbuf" ></param>///<param Name= "nsize" ></param>///<param name= "nbufpoolsize" ></param>///<returns> </returns> [DllImport ("PlayCtrl.dll")] public static extern bool Playm4_openstream (int nport, by
Te[] Pfileheadbuf, UInt32 nsize, uint nbufpoolsize); <summary>///Sets the maximum buffer frame number of the play buffer///</summary>///<param name= "Nport" ><
;/param>///<param name= "Nnum" ></param>///<returns></returns>
[DllImport ("PlayCtrl.dll")] public static extern bool Playm4_setdisplaybuf (int nport, uint nbufpoolsize); <summary>///Open play///</summary>///<param name= "Nport" ></pa ram>///<param name= "hWnd" ></param>///<returns></returns> [DllImport ("PlayCtrl.dll")] public static extern bool Playm4_play (int nport, I
Ntptr hWnd); <summary>///began to pour///</summary>///<param name= "Nport" ></PARAM&G
T <returns></returns> [DllImport ("PlayCtrl.dll")] public static extern bool Playm4_rever
Seplay (int nport); <summary>///input stream data///</summary>///<param name= "Nport" ></param&
Gt <param name= "PBuf" ></param>///<param name= "nsize" ></param>///<retur ns></returns> [DllImport ("PlayCtrl.dll")] public static extern bool Playm4_inputdata (int Npor
T, byte[] pBuf, uint nsize); <summary>///Turn off playback///</summary>///<param name= "Nport" ></PARAM&G
T <returns></returns> [DllImport ("PlayCtrl.dll")] public static extern bool Playm4_stop (int nport); <summary>///closed stream///</summary>///<param name= "Nport" ></ Param>///<returns></returns> [DllImport ("PlayCtrl.dll")] public static Exte
RN bool Playm4_closestream (int nport); <summary>///releases The used channel number///</summary>///<param name= "Nport" ></pa Ram>///<returns></returns> [DllImport ("PlayCtrl.dll")] public static extern
BOOL Playm4_freeport (int nport); #endregion}
This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/net/