Пример #1
0
        protected override void PlayNativeVideo(float volume)
        {
            video.Rewind();
            for (int index = 0; index < NumberOfBuffers; index++)
            {
                if (!Stream(buffers[index]))
                {
                    break;
                }
            }
            video.Play();
            openAL.Play(channelHandle);
            openAL.SetVolume(channelHandle, volume);
            elapsedSeconds = 0.0f;
            Size size = new Size(video.Width, video.Height);

            if (image == null)
            {
                image = ContentLoader.Create <Image>(new ImageCreationData(size)
                {
                    BlendMode = BlendMode.Opaque
                });
            }
            Shader shader = ContentLoader.Create <Shader>(new ShaderCreationData(ShaderFlags.Position2DTextured));

            surface = new Sprite(new Material(shader, image), ScreenSpace.Current.Viewport);
        }
Пример #2
0
 protected override void PlayNativeMusic()
 {
     musicStream.Rewind();
     for (int index = 0; index < NumberOfBuffers; index++)
     {
         if (!Stream(buffers[index]))
         {
             break;
         }
     }
     openAL.Play(channelHandle);
     playStartTime = DateTime.Now;
 }