public void Stop() { #if UNITY #else Stopped = true; videoTime = 0; gameTime = 0; if (rgbDecoder != null) { rgbDecoder.Dispose(); rgbDecoder = null; } if (rgbStream != null) { rgbStream.Dispose(); rgbStream = null; } if (alphaDecoder != null) { alphaDecoder.Dispose(); alphaDecoder = null; } if (alphaStream != null) { alphaStream.Dispose(); alphaStream = null; } #endif }
private void Open() { #if UNITY #else if (Path == null) { throw new ArgumentException(); } Stop(); rgbStream = AssetBundle.Current.OpenFile(Path + ".ogv"); rgbDecoder = new OgvDecoder(rgbStream); foreach (var i in new string[] { "_alpha.ogv", "_Alpha.ogv" }) { if (AssetBundle.Current.FileExists(Path + i)) { alphaStream = AssetBundle.Current.OpenFile(Path + i); alphaDecoder = new OgvDecoder(alphaStream); break; } } this.ImageSize = rgbDecoder.FrameSize; this.SurfaceSize = ImageSize; pixels = new Color4[ImageSize.Width * ImageSize.Height]; #endif }