很久以前看rm檔案的時候會自己跳出網頁,我覺得滿神奇的,現在知道原來 wmv檔案也有了,只是他的term是 ScriptCommand。 ScriptCommand包含三個東西 string Type; string Command: TimeSpan Time; 比較奇怪的是,我使用WMPlayer元件無法取得wmv檔案的所有ScriptCommand。 例如: 1: for ( int i = 1; i <= this .WMPlayer.currentMedia.markerCount; i++) 2: { 3: int MarkerTime = ( int ) this .WMPlayer.currentMedia.getMarkerTime(i); 4: string MarkerName = this .WMPlayer.currentMedia.getMarkerName(i).ToString(); 5: } 這樣我就可以取得所有的Marker標記,但對於ScriptCommand卻無法取得,反而是WMPlayer提供一個事件 WMPlayer.ScriptCommand 1: void WMPlayer_ScriptCommand( object sender, AxWMPLib._WMPOCXEvents_ScriptCommandEvent e) 2: { 3: if (e.scType == "caption" ) 4: MessageBox.Show(e.param, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information); 5: } 然後我們可以從 string e.param 取得 Command,然後 string e.scType 取得Type,注意他的型別都是string,所以彈性是很大的,你可以用Type=”caption”來代表要放一個字幕上去,用Type=”url”來代表要開啟一個URL。這樣在silverlight播放器就可以有很多應用~ 但我們...