/// <summary> /// Seek movie from mods. /// </summary> /// <param name="name">Name of movie to seek including .VID extension.</param> /// <param name="videoPlayerDrawer">Video player with imported video and sound data.</param> /// <returns>True if movie is found.</returns> public static bool TryImportMovie(string name, out VideoPlayerDrawer videoPlayerDrawer) { if (DaggerfallUnity.Settings.MeshAndTextureReplacement) { // Remove VID extension int index = name.LastIndexOf(".VID"); if (index > 0) { name = name.Substring(0, index); } // Seek from loose files string path = Path.Combine(moviePath, name + ".mp4"); if (File.Exists(path)) { videoPlayerDrawer = new VideoPlayerDrawer(path); return(true); } // Seek from mods VideoClip videoClip; if (ModManager.Instance != null && ModManager.Instance.TryGetAsset(name, false, out videoClip)) { videoPlayerDrawer = new VideoPlayerDrawer(videoClip); return(true); } } videoPlayerDrawer = null; return(false); }
public override void Update() { base.Update(); // Handle exit any key or end of video if (useCustomVideo) { if (endOnAnyKey && Input.anyKeyDown || !customVideo.IsPlaying) { customVideo.Stop(); customVideo.Dispose(); customVideo = null; RaiseOnVideoFinishedHandler(); RaiseOnVideoEndGlobalEvent(); CloseWindow(); } } else { if (endOnAnyKey && Input.anyKeyDown || video.VidFile.EndOfFile && video.Playing) { video.Playing = false; video.Dispose(); RaiseOnVideoFinishedHandler(); RaiseOnVideoEndGlobalEvent(); CloseWindow(); } } }
public override void Update() { base.Update(); // Handle exit any key or end of video if (useCustomVideo) { if (endOnAnyKey && InputManager.Instance.AnyKeyDown || Input.GetKeyDown(KeyCode.Escape) || !customVideo.IsPlaying) { customVideo.Stop(); customVideo.Dispose(); customVideo = null; DoHideCursor(false); RaiseOnVideoFinishedHandler(); RaiseOnVideoEndGlobalEvent(); CloseWindow(); } } else { if (endOnAnyKey && InputManager.Instance.AnyKeyDown || Input.GetKeyDown(KeyCode.Escape) || video.VidFile.EndOfFile && video.Playing) { video.Playing = false; video.Dispose(); video = null; DoHideCursor(false); RaiseOnVideoFinishedHandler(); RaiseOnVideoEndGlobalEvent(); CloseWindow(); } } }