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(); } } }
// Code that runs on entering the state. public override void OnEnter() { if (mStaticThings.I == null) { return; } CustomVideoPlayer cvp = new CustomVideoPlayer { ContorlObj = ContorlObj.Value, RenderObj = RenderObj, url = url.Value, vol = vol.Value, isloop = isloop.Value, autostart = autostart.Value }; MessageDispatcher.SendMessage(this, VrDispMessageType.InitVideoPlayer.ToString(), cvp, 0); Finish(); }