public static void ChangeVideo(MediaPlayer media) { _Paths = ReadExternalFilesTools.FindAllFiles(Application.streamingAssetsPath, ".mp4"); media.m_VideoPath = _Paths[_VideoIndex]; _VideoIndex = (_VideoIndex + 1) % (_Paths.Count); if (string.IsNullOrEmpty(media.m_VideoPath)) { media.CloseVideo(); _VideoIndex = 0; } else { media.OpenVideoFromFile(_location, media.m_VideoPath, true); } }
public static void ChangeVideo(MediaPlayer media, string name, bool isOn) { _Paths = ReadExternalFilesTools.FindAllFiles(Application.streamingAssetsPath, ".mp4"); for (int i = 0; i < _Paths.Count; i++) { if (_Paths[i].Split('\\')[_Paths[i].Split('\\').Length - 1].Replace(".mp4", "").Equals(name)) { media.m_VideoPath = _Paths[i]; if (string.IsNullOrEmpty(media.m_VideoPath)) { media.CloseVideo(); _VideoIndex = 0; } else { Debug.Log(_Paths[i]); media.OpenVideoFromFile(_location, media.m_VideoPath, isOn); } } } }