예제 #1
0
        /// <summary>
        /// Play video
        /// </summary>
        /// <param name="extraInputParameters">Extra FFmpeg input parameters to be passed</param>
        public void Play(string extraInputParameters = "")
        {
            if (OpenedForWriting)
            {
                throw new InvalidOperationException("Player is already opened for writing frames!");
            }
            if (string.IsNullOrEmpty(Filename))
            {
                throw new InvalidOperationException("No filename was specified!");
            }

            FFmpegWrapper.RunCommand(ffplay, $"{extraInputParameters} -i \"{Filename}\"");
        }
예제 #2
0
        /// <summary>
        /// Play audio
        /// </summary>
        public void Play(bool showWindow = false)
        {
            if (OpenedForWriting)
            {
                throw new InvalidOperationException("Player is already opened for writing samples!");
            }
            if (string.IsNullOrEmpty(Filename))
            {
                throw new InvalidOperationException("No filename was specified!");
            }

            FFmpegWrapper.RunCommand(ffplay, $"-i \"{Filename}\"" + (showWindow ? "" : " -nodisp"));
        }