Exemplo n.º 1
0
        // [SerializeField, HideInInspector]
        /// <summary>
        /// The path to the movie for MPMP to play </summary>
        // protected string _moviePath;
        public override bool SetValues(ClipPlayer.PlayerValues values)
        {
            _mediaPlayer = gameObject.GetComponent <monoflow.MPMP>();

            if (_mediaPlayer == null)
            {
                // no media component already added to this component, try adding a MediaPlayer component
                try
                {
                    _mediaPlayer = gameObject.AddComponent <monoflow.MPMP>();
                }

                catch (Exception e)
                {
                    Debug.LogError("MPMP not found in project: " + e.ToString());
                    return(false);
                }
            }

            if (values.moviePath != "")
            {
                //set the path of the movie based on passed in params
                _mediaPlayer.videoPath = values.moviePath;
                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
        // [SerializeField, HideInInspector]
        /// <summary>
        /// The path to the movie for MPMP to play </summary>
        // protected string _moviePath;


        /// <param name="moviePath">Filename of the movie</param>
        public bool Setup(string moviePath)
        {
            // Debug.Log("setting up mpmp");
            _mediaPlayer = gameObject.GetComponent <monoflow.MPMP>();
            //if no mpmp component is already attached to this script
            if (_mediaPlayer == null)
            {
                // Debug.Log("no mpmp component found on script");
                //try adding an mpmp component
                try
                {
                    _mediaPlayer = gameObject.AddComponent <monoflow.MPMP>();
                }

                catch (Exception e)
                {
                    Debug.LogError("MPMP not found in project: " + e.ToString());
                    return(false);
                }
            }

            //ensure we are attached to the correct MPMP component
            // _mediaPlayer = gameObject.GetComponent<MPMP>();

            if (moviePath == "")
            {
                return(false);
            }

            else
            {
                //set the path of the movie based on passed in params
                // _moviePath = moviePath;
                _mediaPlayer.videoPath = moviePath;
                //MPMP needs the video to be loaded
                // _mediaPlayer.Load(_moviePath);
                // Debug.Log("MPMPPlayer Setup");
                return(true);
            }
        }
Exemplo n.º 3
0
 void _OnLoaded(monoflow.MPMP instance)
 {
     instance.Play();
 }
Exemplo n.º 4
0
 private void _OnBuffering(monoflow.MPMP mpmp)
 {
     //Debug.Log("OnBuffering");
     Debug.Log("API Test::OnBuffering:" + mpmp.GetBufferLevel());
 }