public override void start() { GameObject objLayer = UIMgr.CreateLayer(10); if (objLayer != null) { objLayer.SetActive(true); VideoFile theVideo = VideoMgr.CreateVideoPanel(movFile, objLayer); UnityEngine.Video.VideoClip clip = AssetLoader.Load <UnityEngine.Video.VideoClip>(movFile); theVideo.Play(clip); } this.isEnd = true; }
void _play_movie_url() { EventMgr.startEvent("显示关闭按钮"); GameObject objLayer = UIMgr.CreateLayer(10); if (objLayer != null) { VideoFile theVideo = VideoMgr.CreateVideoPanel("movie", objLayer); // string movFile = System.Environment.CurrentDirectory + @"/姜子牙.mp4"; // string movFile = @"c:\迅雷下载\The.Eight.Hundred.2020.1080p.HDRip.x264.AC3-FEWAT.mp4"; //VideoMgr.PlayUrl(@"h:\Movies\babes tracy lindsay and aiko may sexors.mp4"); // VideoMgr.PlayUrl(@"h:\Dolby\DOLBY.VISION.CES.March.2018.UHD.BDRemux.2160p.DV.IVA.ExKinoRay\02.Chameleon.mp4"); // VideoMgr.PlayUrl("file://" + @Application.streamingAssetsPath + @"/姜子牙.mp4"); string movFile = @System.Environment.CurrentDirectory + @"\Pinball-JDBBS.mp4"; theVideo.playUrl(movFile); //EventMgr.startEvent("播放视频"); } }
public static void ShowList(LIST_TYPE newType) { listType = newType; Instance.objEditPanel.SetActive(true); int nCount = 0; switch (listType) { case LIST_TYPE.audio_Inner: nCount = audio.lisVideoRes.Count; foreach (string mediaName in audio.lisVideoRes) { Button button = EditorPanel.AddItem(mediaName); button.onClick.AddListener(() => { EventMgr.startEvent("显示关闭按钮"); GameObject objLayer = UIMgr.CreateLayer(10); if (objLayer != null) { EditorPanel.Instance.gameObject.SetActive(false); AudioClip clipMp3 = Resources.Load <AudioClip>("Media/" + mediaName); Music music = MusicMgr.PlayMp3(clipMp3); music.gameObject.AddComponent <_Astroid>(); } }); } break; case LIST_TYPE.audio_Url: nCount = audio.lisVideoUrl.Count; foreach (string mediaName in audio.lisVideoUrl) { Button button = EditorPanel.AddItem(mediaName); button.onClick.AddListener(() => { EventMgr.startEvent("显示关闭按钮"); GameObject objLayer = UIMgr.CreateLayer(10); if (objLayer != null) { EditorPanel.Instance.gameObject.SetActive(false); VideoFile theVideo = VideoMgr.CreateVideoPanel("movie", objLayer); theVideo.playUrl(mediaName); } }); } break; case LIST_TYPE.audio_Streaming: nCount = audio.lisVideoStreaming.Count; foreach (string mediaName in audio.lisVideoStreaming) { Button button = EditorPanel.AddItem(mediaName); button.onClick.AddListener(() => { EventMgr.startEvent("显示关闭按钮"); GameObject objLayer = UIMgr.CreateLayer(10); if (objLayer != null) { EditorPanel.Instance.gameObject.SetActive(false); Instance.StartCoroutine(Instance.LoadMusic(mediaName)); // VideoFile theVideo = VideoMgr.CreateVideoPanel("movie", objLayer); // theVideo.playUrl(mediaName); } }); } break; case LIST_TYPE.video_Inner: nCount = video.lisVideoRes.Count; foreach (string mediaName in video.lisVideoRes) { Button button = EditorPanel.AddItem(mediaName); button.onClick.AddListener(() => { EventMgr.startEvent("显示关闭按钮"); GameObject objLayer = UIMgr.CreateLayer(10); if (objLayer != null) { EditorPanel.Instance.gameObject.SetActive(false); VideoFile theVideo = VideoMgr.CreateVideoPanel("movie", objLayer); VideoClip videoClip = Resources.Load <VideoClip>("Media/" + mediaName); theVideo.Play(videoClip); } }); } break; case LIST_TYPE.video_Url: nCount = video.lisVideoUrl.Count; foreach (string mediaName in video.lisVideoUrl) { Button button = EditorPanel.AddItem(mediaName); button.onClick.AddListener(() => { EventMgr.startEvent("显示关闭按钮"); GameObject objLayer = UIMgr.CreateLayer(10); if (objLayer != null) { EditorPanel.Instance.gameObject.SetActive(false); VideoFile theVideo = VideoMgr.CreateVideoPanel("movie", objLayer); theVideo.playUrl(mediaName); } }); } break; case LIST_TYPE.video_Streaming: nCount = video.lisVideoStreaming.Count; foreach (string mediaName in video.lisVideoStreaming) { Button button = EditorPanel.AddItem(mediaName); button.onClick.AddListener(() => { EventMgr.startEvent("显示关闭按钮"); GameObject objLayer = UIMgr.CreateLayer(10); if (objLayer != null) { EditorPanel.Instance.gameObject.SetActive(false); VideoFile theVideo = VideoMgr.CreateVideoPanel("movie", objLayer); theVideo.playUrl(mediaName); } }); } break; case LIST_TYPE.List_None: break; } Vector2 sz = EditorPanel.Instance.parent.GetComponent <RectTransform>().sizeDelta; sz.y += 20; sz.y = nCount * 64; EditorPanel.Instance.parent.GetComponent <RectTransform>().sizeDelta = sz; }