/// <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()); }
/// <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)); }
/// <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); }
/// <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; }