public EndGame(ContentManager content) { _video = content.Load<Video>(@"Movies\EndGame"); _endGameFont = content.Load<SpriteFont>(@"Fonts\MenuFont"); _videoPlayer = new VideoPlayer(); }
public IntroScreen() { XactManager.CurrentSong.Stop(AudioStopOptions.Immediate); intro = MainGame.GetInstance().Content.Load<Video>("Video\\Introduction"); videoPlayer = new VideoPlayer(); videoPlayer.Play(intro); }
private VideoManager() { video = EvilutionGame.SContent.Load<Video>("video\\Birth of the earth"); Font = FontManager.LoadFont("font/menuItems"); videoPlayer = new VideoPlayer(); }
protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); Services.AddService(typeof(SpriteBatch), spriteBatch); video = Content.Load<Video>("Video\\Intro"); videoplayer = new VideoPlayer(); videoplayer.Play(video); }
public override void LoadContent() { spritebatch = new SpriteBatch(Game.GraphicsDevice); video = Game.Content.Load<Video>(@"Movies\FuturamaIntro"); player.Play(video); this.Enabled = true; this.Visible = true; }
public void LoadContent(ContentManager content) { this.video = content.Load<Video>(this.videoPath); this.screenSize = new Rectangle(0, 0, 720, 576); if (this.state == 0) { this.videoPlayer.Play(this.video); } }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); titleVideo = Content.Load<Video>(@"titleVideo"); videoPlayer = new VideoPlayer(); // TODO: use this.Content to load your game content here }
public void Play(string asset, GameState onFinish) { if (videoPlayer.State == MediaState.Playing) return; int videoIndex = videoAssets.IndexOf(asset); activeVideo = videos[videoIndex]; videoPlayer.Play(activeVideo); this.onFinish = onFinish; this.GameState = GameState.ANIMATION; }
protected override void LoadData(Stream fileData) { try { video = graphicsDevice.NativeContent.Load<XnaMedia.Video>(Name); } catch (Exception ex) { Logger.Error(ex); if (Debugger.IsAttached) throw new XnaVideoContentNotFound(Name, ex); } }
public override void LoadContent() { if (content == null) content = new ContentManager(ScreenManager.Game.Services, "Content"); pictureBackground = content.Load<Texture2D>("Backgrounds\\Ninjitus_title"); gameTitle = content.Load<Texture2D>("Backgrounds\\Ninjitsu"); gameTitlePosition = new Rectangle(80, 150, gameTitle.Width, gameTitle.Height); DemoVideo = content.Load<Video>("Backgrounds\\Demo"); Statics.VideoPlayer = new VideoPlayer(); Statics.VideoPlayer.IsLooped = true; Statics.VideoPlayer.Play(DemoVideo); }
protected override void LoadData(Stream fileData) { try { video = graphicsDevice.NativeContent.Load <XnaMedia.Video>(Name); } catch (Exception ex) { Logger.Error(ex); if (Debugger.IsAttached) { throw new XnaVideoContentNotFound(Name, ex); } } }
public override void LoadContent() { if (content == null) content = new ContentManager(ScreenManager.Game.Services, "Content"); gameFont = content.Load<SpriteFont>("gamefont"); backgroundTexture = content.Load<Texture2D>("Screen Images\\End Screen Copy"); video = content.Load<Video>("Ending"); }
public void playMovie(string videos) { video = Content.Load<Video>(videos); videoPlayer.Play(video); }
public GOVideo(Video _VideoFile, Rectangle _rect) : base(null, _rect) { videoPlayer = new VideoPlayer(); videoPlayer.Volume = Game1.songLiberty.VolumeMusic; VideoFile = _VideoFile; Visible = true; rect = _rect; videoPlayer.IsLooped = false; videoPlayer.Play(VideoFile); }
public void Play(Video video) { checkDisposed(); // We need to assign this regardless of what happens next. Video = video; Video.AttachedToPlayer = true; // FIXME: This is a part of the Duration hack! if (Video.needsDurationHack) { Video.Duration = TimeSpan.MaxValue; } // Check the player state before attempting anything. if (State != MediaState.Stopped) { return; } // Update the player state now, before initializing State = MediaState.Playing; // Hook up the decoder to this player InitializeTheoraStream(); // Set up the texture data if (TheoraPlay.THEORAPLAY_hasVideoStream(Video.theoraDecoder) != 0) { // The VideoPlayer will use the GraphicsDevice that is set now. if (currentDevice != Video.GraphicsDevice) { GL_dispose(); currentDevice = Video.GraphicsDevice; GL_initialize(); } RenderTargetBinding overlap = videoTexture[0]; videoTexture[0] = new RenderTargetBinding( new RenderTarget2D( currentDevice, (int)currentVideo.width, (int)currentVideo.height, false, SurfaceFormat.Color, DepthFormat.None, 0, RenderTargetUsage.PreserveContents ) ); if (overlap.RenderTarget != null) { overlap.RenderTarget.Dispose(); } GL_setupTextures( (int)currentVideo.width, (int)currentVideo.height ); } // The player can finally start now! FNALoggerEXT.LogInfo("Starting Theora player..."); timer.Start(); if (audioStream != null) { audioStream.Play(); } FNALoggerEXT.LogInfo("Started!"); }
public void Play(Microsoft.Xna.Framework.Media.Video video) { _video = video; PlayVideo(); }
public MenuModule(Video video) { this.video = video; }
protected override void DisposeData() { base.DisposeData(); video = null; }
public override void UnloadContent() { player.Stop(); player = null; video = null; }
protected override void LoadContent() { introvid = game.Content.Load<Video>("Video/intro_render"); introMusic = game.Content.Load<Song>("Music/intro"); player = new VideoPlayer(); }
protected override void Initialize() { // Create a new SpriteBatch, which can be used to draw textures. SpriteBatch = new SpriteBatch(GraphicsDevice); // device = graphics.GraphicsDevice; ScreenWidth = graphics.PreferredBackBufferWidth; ScreenHeight = graphics.PreferredBackBufferHeight; video = Content.Load<Video>("media/IntroVideo"); videoPlayer = new VideoPlayer(); videoPlayer.Play(video); videoColor = new Color(255, 255, 255); base.Initialize(); }
public override void Initialize() { video = parentManager.game.Content.Load<Video>("Video/intro"); player = new VideoPlayer(); }
public Texture2D GetTexture() { checkDisposed(); if (Video == null) { throw new InvalidOperationException(); } // Be sure we can even get something from TheoraPlay... if (State == MediaState.Stopped || Video.theoraDecoder == IntPtr.Zero || TheoraPlay.THEORAPLAY_isInitialized(Video.theoraDecoder) == 0 || TheoraPlay.THEORAPLAY_hasVideoStream(Video.theoraDecoder) == 0) { // Screw it, give them the old one. return(videoTexture[0].RenderTarget as Texture2D); } // Get the latest video frames. bool hasFrames = true; while (nextVideo.playms <= timer.ElapsedMilliseconds && hasFrames) { currentVideo = nextVideo; hasFrames = TheoraPlay.THEORAPLAY_availableVideo(Video.theoraDecoder) > 0; if (hasFrames) { IntPtr nextFrame = TheoraPlay.THEORAPLAY_getVideo(Video.theoraDecoder); TheoraPlay.THEORAPLAY_freeVideo(previousFrame); previousFrame = Video.videoStream; Video.videoStream = nextFrame; nextVideo = TheoraPlay.getVideoFrame(Video.videoStream); } } // Check for the end... if (TheoraPlay.THEORAPLAY_isDecoding(Video.theoraDecoder) == 0) { // FIXME: This is part of the Duration hack! if (Video.needsDurationHack) { Video.Duration = new TimeSpan(0, 0, 0, 0, (int)currentVideo.playms); } // Stop and reset the timer. If we're looping, the loop will start it again. timer.Stop(); timer.Reset(); // Kill whatever audio/video we've got if (audioStream != null) { audioStream.Stop(); audioStream.Dispose(); audioStream = null; } TheoraPlay.THEORAPLAY_freeVideo(previousFrame); Video.AttachedToPlayer = false; Video.Dispose(); // If looping, go back to the start. Otherwise, we'll be exiting. if (IsLooped && State == MediaState.Playing) { // Starting over! Video.AttachedToPlayer = true; InitializeTheoraStream(); // Start! Again! timer.Start(); if (audioStream != null) { audioStream.Play(); } } else { // We out, give them the last frame. State = MediaState.Stopped; return(videoTexture[0].RenderTarget as Texture2D); } } // Set up an environment to muck about in. GL_pushState(); // Prepare YUV GL textures with our current frame data currentDevice.GLDevice.SetTextureData2DPointer( yuvTextures[0], currentVideo.pixels ); currentDevice.GLDevice.SetTextureData2DPointer( yuvTextures[1], new IntPtr( currentVideo.pixels.ToInt64() + (currentVideo.width * currentVideo.height) ) ); currentDevice.GLDevice.SetTextureData2DPointer( yuvTextures[2], new IntPtr( currentVideo.pixels.ToInt64() + (currentVideo.width * currentVideo.height) + (currentVideo.width / 2 * currentVideo.height / 2) ) ); // Draw the YUV textures to the framebuffer with our shader. currentDevice.DrawPrimitives( PrimitiveType.TriangleStrip, 0, 2 ); // Clean up after ourselves. GL_popState(); // Finally. return(videoTexture[0].RenderTarget as Texture2D); }