/// <param name="moviePath">Path to the movie. Format here varies based on location.</param> /// <param name="fileLocation">What file or folder the given path is relative to.</param> public override bool SetValues(PlayerValues values) { _mediaPlayer = gameObject.GetComponent <RenderHeads.Media.AVProVideo.MediaPlayer>(); if (_mediaPlayer == null) { // no media component already added to this component, try adding a MediaPlayer component try { _mediaPlayer = gameObject.AddComponent <RenderHeads.Media.AVProVideo.MediaPlayer>(); } catch (Exception e) { Debug.LogError("AVProVideo not found in project: " + e.ToString()); return(false); } } //disable autoplay and autoload, which are on by default _mediaPlayer.m_AutoStart = false; _mediaPlayer.m_AutoOpen = false; //relies on exact parity between enum values in AVProVideo and Clip _mediaPlayer.m_VideoLocation = (RenderHeads.Media.AVProVideo.MediaPlayer.FileLocation)((int)values.location); if (values.moviePath != "") { //cache the movie path reference _mediaPlayer.m_VideoPath = values.moviePath; return(true); } return(false); }
public override void CreatePlayer() { _mediaPlayer = gameObject.GetComponent <RenderHeads.Media.AVProVideo.MediaPlayer>(); if (_mediaPlayer == null) { // no media component already added to this component, try adding a MediaPlayer component try { _mediaPlayer = gameObject.AddComponent <RenderHeads.Media.AVProVideo.MediaPlayer>(); } catch (Exception e) { Debug.LogError("AVProVideo not found in project: " + e.ToString()); } } }
//[SerializeField] /// <summary> /// Reference to the path of the movie. </summary> //protected string _moviePath; /// <param name="moviePath">Path to the movie. Format here varies based on location.</param> /// <param name="fileLocation">What file or folder the given path is relative to.</param> public bool Setup(string moviePath, DepthKit.FileLocation fileLocation) { _mediaPlayer = gameObject.GetComponent <RenderHeads.Media.AVProVideo.MediaPlayer>(); //if no avprovideo component is already attached to this object if (_mediaPlayer == null) { //try adding an MediaPlayer components try { _mediaPlayer = gameObject.AddComponent <RenderHeads.Media.AVProVideo.MediaPlayer>(); } catch (Exception e) { Debug.LogError("AVProVideo not found in project: " + e.ToString()); return(false); } } //disable autoplay and autoload, which are on by default _mediaPlayer.m_AutoStart = false; _mediaPlayer.m_AutoOpen = false; //relies on exact parity between enum values in AVProVideo and Clip _mediaPlayer.m_VideoLocation = (RenderHeads.Media.AVProVideo.MediaPlayer.FileLocation)((int)fileLocation); if (moviePath != "") { //cache the movie path reference //_moviePath = moviePath; //assing the reference to the _mediaPlayer _mediaPlayer.m_VideoPath = moviePath; // Debug.Log("AVProVideoPlayer Setup"); return(true); } return(false); }