MediaPlayerEvent.cs 794 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using UnityEngine;
  2. using System.Collections;
  3. public class MediaPlayerEvent : MonoBehaviour {
  4. public MediaPlayerCtrl m_srcVideo;
  5. // Use this for initialization
  6. void Start () {
  7. m_srcVideo.OnReady += OnReady;
  8. m_srcVideo.OnVideoFirstFrameReady += OnFirstFrameReady;
  9. m_srcVideo.OnVideoError += OnError;
  10. m_srcVideo.OnEnd += OnEnd;
  11. m_srcVideo.OnResize += OnResize;
  12. }
  13. // Update is called once per frame
  14. void Update () {
  15. }
  16. void OnReady() {
  17. Debug.Log ("OnReady");
  18. }
  19. void OnFirstFrameReady() {
  20. Debug.Log ("OnFirstFrameReady");
  21. }
  22. void OnEnd() {
  23. Debug.Log ("OnEnd");
  24. }
  25. void OnResize()
  26. {
  27. Debug.Log ("OnResize");
  28. }
  29. void OnError(MediaPlayerCtrl.MEDIAPLAYER_ERROR errorCode, MediaPlayerCtrl.MEDIAPLAYER_ERROR errorCodeExtra){
  30. Debug.Log ("OnError");
  31. }
  32. }