Ejemplo n.º 1
0
    public bool LoadMovieFromMemory(bool autoPlay, string name, System.IntPtr moviePointer, uint movieLength)
    {
        bool result = true;

        if (_moviePlayer == null)
        {
            _moviePlayer = new AVProWindowsMedia();
        }

        bool allowNativeFormat = (_colourFormat != ColourFormat.RGBA32);

        if (_moviePlayer.StartVideoFromMemory(name, moviePointer, movieLength, _loop, allowNativeFormat, _colourFormat == ColourFormat.YCbCr_HD))
        {
            _moviePlayer.Volume = _volume;
            if (autoPlay)
            {
                _moviePlayer.Play();
            }
        }
        else
        {
            Debug.LogWarning("[AVProWindowsMedia] Couldn't load movie " + _filename);
            UnloadMovie();
            result = false;
        }

        return(result);
    }
    public bool LoadMovieFromMemory(bool autoPlay, string name, System.IntPtr moviePointer, long movieLength, FilterMode textureFilterMode, TextureWrapMode textureWrapMode)
    {
        bool result = true;

        if (_moviePlayer == null)
        {
            _moviePlayer = new AVProWindowsMedia();
        }

        bool allowNativeFormat = (_colourFormat != ColourFormat.RGBA32);

        if (_moviePlayer.StartVideoFromMemory(name, moviePointer, movieLength, allowNativeFormat, _colourFormat == ColourFormat.YCbCr_HD, _allowAudio, _useAudioDelay, _useAudioMixer, _useDisplaySync, _ignoreFlips, textureFilterMode, textureWrapMode))
        {
            if (_allowAudio)
            {
                _moviePlayer.Volume       = _volume;
                _moviePlayer.AudioBalance = _audioBalance;
            }
            _moviePlayer.Loop = _loop;
            if (autoPlay)
            {
                _moviePlayer.Play();
            }
        }
        else
        {
            Debug.LogWarning("[AVProWindowsMedia] Couldn't load movie " + _filename);
            UnloadMovie();
            result = false;
        }

        return(result);
    }