Playback Events
During the playback, the following events are fired:
void OnPlayerEvent(Player_State ev, string info, long param)
{
switch (ev)
{
case Player_State.Starting:
break;
case Player_State.WaitingFordata:
break;
case Player_State.Running:
break;
case Player_State.Paused:
break;
case Player_State.Stopped:
break;
case Player_State.Completed:
break;
case Player_State.Error:
break;
case Player_State.Demo_Expired:
break;
case Player_State.DurationChanged:
break;
case Player_State.SegmentChanged:
break;
case Player_State.SegmentListChanged:
break;
default:
break;
}
}
Error Event.
If there is an error, the player will report it with an Error event:
void OnErrorEvent(Error_Type e, string err)
{
ReportError("Error {0} - {1}", e, err);
}
PID detection.
When the player completes detection, it reports the list of PIDs found in the stream.
void OnPidDetectionEvent(List<PidInfoWr> pidList)
{
pidList.ForEach(pid =>
{
switch(pid.streamType)
{
case StreamType.VIDEO:
break;
case StreamType.KLV:
break;
case StreamType.PRIVATE_DATA:
break;
}
});
}
- Note
- You only need to set this event if you need this information. For simple playback, it is not needed.
Sync Frame event.
When the player completes frame decoding, it reports the list of synced data packets.
void OnSyncFrameEvent(List<StreamFrameInfoWr> streamList)
{
streamList.ForEach(delegate(StreamFrameInfoWr streamFrame)
{
switch (streamFrame.streamType)
{
case StreamType.VIDEO:
{
VideoFrameInfoWr vf = streamFrame as VideoFrameInfoWr;
}
break;
case StreamType.KLV:
{
KlvFrameInfoWr kf = streamFrame as KlvFrameInfoWr;
if (kf.duplicateCounter == 0 && kf.decodedData != null)
{
}
}
break;
case StreamType.PRIVATE_DATA:
{
DataFrameInfoWr df = streamFrame as DataFrameInfoWr;
if (df.duplicateCounter == 0)
{
}
}
break;
}
});
}
- Note
- You only need to set this event if you need this information. For simple playback it is not needed.