using RenderHeads.Media.AVProVideo;
ublic MediaPlayer myVideo;
voidStrat(){
Player();
myVideo.Events.AddListener(OnVideoEvent);//监听播放事件
}voidPlayer(){
myVideo.play();//播放方法
myVideo.pause();//暂停方法
myVideo.stop();//停止播放}
publicvoid OnVideoEvent(MediaPlayer mp, MediaPlayerEvent.EventType et, ErrorCode errorCode){
switch (et) {
case MediaPlayerEvent.EventType.ReadyToPlay://装备播放
break;
case MediaPlayerEvent.EventType.Started://开始播放
break;
case MediaPlayerEvent.EventType.FirstFrameReady://播放第一帧
break;
case MediaPlayerEvent.EventType.FinishedPlaying://播放最后一帧
recivemessage();
break;
}
}