Пример #1
0
        /// <summary>
        /// Asynchronously plays a stream.
        /// </summary>
        /// <param name="uri">The uri of a stream to play.</param>
        /// <exception cref="ArgumentException">An invalid string is passed as an argument.</exception>
        /// <exception cref="Win32Exception">Failed to load the FFmpeg facade dll.</exception>
        /// <exception cref="StreamPlayerException">Failed to play the stream.</exception>
        public void StartPlay(Uri uri)
        {
            if (IsPlaying)
            {
                Stop();
            }

            Player.StartPlay(uri.ToString());
        }
Пример #2
0
        /// <summary>
        /// Asynchronously plays a stream.
        /// </summary>
        /// <param name="uri">The uri of a stream to play.</param>
        /// <param name="connectionTimeout"></param>
        /// <exception cref="Win32Exception">Failed to load the FFmpeg facade dll.</exception>
        /// <exception cref="StreamPlayerException">Failed to play the stream.</exception>
        public void StartPlay(Uri uri, TimeSpan connectionTimeout)
        {
            if (IsPlaying)
            {
                Stop();
            }

            Player.StartPlay(uri.IsFile ? uri.LocalPath : uri.ToString(),
                             Convert.ToInt32(connectionTimeout.TotalMilliseconds));
        }
Пример #3
0
        /// <summary>
        /// Asynchronously plays a stream.
        /// </summary>
        /// <param name="uri">The uri of a stream to play.</param>
        /// <exception cref="ArgumentException">An invalid string is passed as an argument.</exception>
        /// <exception cref="Win32Exception">Failed to load the FFmpeg facade dll.</exception>
        /// <exception cref="StreamPlayerException">Failed to play the stream.</exception>
        /// <param name="connectionTimeout">The connection timeout.</param>
        public void StartPlay(Uri uri, TimeSpan connectionTimeout)
        {
            if (IsPlaying)
            {
                Stop();
            }

            Player.StartPlay(uri.IsFile ? uri.LocalPath : uri.ToString(),
                             connectionTimeout);
        }
Пример #4
0
        /// <summary>
        /// Asynchronously plays a stream.
        /// </summary>
        /// <param name="url">The url of a stream to play.</param>
        /// <exception cref="ArgumentException">An invalid string is passed as an argument.</exception>
        /// <exception cref="Win32Exception">Failed to load the FFmpeg facade dll.</exception>
        /// <exception cref="StreamPlayerException">Failed to play the stream.</exception>
        public void StartPlay(String url)
        {
            if (string.IsNullOrWhiteSpace(url))
            {
                throw new ArgumentException();
            }

            if (IsPlaying)
            {
                Stop();
            }

            Player.StartPlay(url);
            //Player.Play();

            //IsPlaying = true;
        }