protected override void Setup() { if (useCustomVideo = VideoReplacement.TryImportMovie(PlayOnStart, out customVideo)) { // Play custom video customVideo.Size = new Vector2(Screen.width, Screen.height); NativePanel.Components.Add(customVideo); DoHideCursor(hideCursor); customVideo.Play(); RaiseOnVideoStartGlobalEvent(); } else { const int nativeScreenWidth = 320; const int nativeScreenHeight = 200; // Add video player control video = new DaggerfallVideo(); video.HorizontalAlignment = HorizontalAlignment.Center; video.Size = new Vector2(nativeScreenWidth, nativeScreenHeight); NativePanel.Components.Add(video); DoHideCursor(hideCursor); // Start playing if (!string.IsNullOrEmpty(PlayOnStart)) { video.Open(PlayOnStart); video.Playing = true; RaiseOnVideoStartGlobalEvent(); } } }
protected override void Setup() { MovieTexture customMovieTexture; if (VideoReplacement.ImportCustomVideo(PlayOnStart, out customMovieTexture)) { // Play custom video customVideo = new CustomVideoPlayer(); customVideo.PlayVideo(customMovieTexture); NativePanel.Components.Add(customVideo); useCustomVideo = true; } else { const int nativeScreenWidth = 320; const int nativeScreenHeight = 200; // Add video player control video = new DaggerfallVideo(); video.HorizontalAlignment = HorizontalAlignment.Center; video.Size = new Vector2(nativeScreenWidth, nativeScreenHeight); NativePanel.Components.Add(video); // Start playing if (!string.IsNullOrEmpty(PlayOnStart)) { video.Open(PlayOnStart); video.Playing = true; Cursor.visible = false; RaiseOnVideoStartGlobalEvent(); } } }
protected override void Setup() { // Add video player control video = new DaggerfallVideo(); video.HorizontalAlignment = HorizontalAlignment.Center; video.Size = new Vector2(nativeScreenWidth, nativeScreenHeight); NativePanel.Components.Add(video); // Start playing if (!string.IsNullOrEmpty(PlayOnStart)) { video.Open(PlayOnStart); video.Playing = true; Cursor.visible = false; } }
public override void Update() { base.Update(); // Handle exit any key or end of video if (useCustomVideo) { if (endOnAnyKey && Input.anyKeyDown || Input.GetKeyDown(KeyCode.Escape) || !customVideo.IsPlaying) { customVideo.Stop(); customVideo.Dispose(); customVideo = null; DoHideCursor(false); RaiseOnVideoFinishedHandler(); RaiseOnVideoEndGlobalEvent(); CloseWindow(); } } else { if (endOnAnyKey && Input.anyKeyDown || Input.GetKeyDown(KeyCode.Escape) || video.VidFile.EndOfFile && video.Playing) { video.Playing = false; video.Dispose(); video = null; DoHideCursor(false); RaiseOnVideoFinishedHandler(); RaiseOnVideoEndGlobalEvent(); CloseWindow(); } } }