Example #1
0
        private async void btnMultiUrl_Click(object sender, RoutedEventArgs e)
        {
            var test = new Uri(tboxNetworkUri.Text);

            var plist = new SYEngine.Playlist(SYEngine.PlaylistTypes.NetworkHttp);
            var cfgs = default(SYEngine.PlaylistNetworkConfigs);
            cfgs.DownloadRetryOnFail = true;
            cfgs.DetectDurationForParts = true;
            cfgs.HttpUserAgent = string.Empty;
            cfgs.HttpReferer = string.Empty;
            cfgs.HttpCookie = string.Empty;
            cfgs.UniqueId = System.IO.Path.GetFileNameWithoutExtension(tboxNetworkUri.Text);
            cfgs.BufferBlockSizeKB = 64; //one block is 64KB
            cfgs.BufferBlockCount = 160; //160 * 64K = 10M network io buf.
            plist.NetworkConfigs = cfgs;
            plist.Append(tboxNetworkUri.Text, 0, 0);
#if DEBUG
            var debugFile = System.IO.Path.Combine(Windows.Storage.ApplicationData.Current.TemporaryFolder.Path, "DebugFile.mkv");
            plist.SetDebugFile(debugFile);
#endif

            tbPlayStatus.Text = string.Empty;
            player.IsLooping = (bool)cboxLoop.IsChecked;
            SYEngine.Core.ForceSoftwareDecode = (bool)cboxSoftDecode.IsChecked;

            player.Source = await plist.SaveAndGetFileUriAsync();
        }
Example #2
0
        private async void btnMultiUrl_Click(object sender, RoutedEventArgs e)
        {
            var test = new Uri(tboxNetworkUri.Text);

            var plist = new SYEngine.Playlist(SYEngine.PlaylistTypes.NetworkHttp);
            var cfgs  = default(SYEngine.PlaylistNetworkConfigs);

            cfgs.DownloadRetryOnFail    = true;
            cfgs.DetectDurationForParts = true;
            cfgs.HttpUserAgent          = string.Empty;
            cfgs.HttpReferer            = string.Empty;
            cfgs.HttpCookie             = string.Empty;
            cfgs.UniqueId          = System.IO.Path.GetFileNameWithoutExtension(tboxNetworkUri.Text);
            cfgs.BufferBlockSizeKB = 64;  //one block is 64KB
            cfgs.BufferBlockCount  = 160; //160 * 64K = 10M network io buf.
            plist.NetworkConfigs   = cfgs;
            plist.Append(tboxNetworkUri.Text, 0, 0);
#if DEBUG
            var debugFile = System.IO.Path.Combine(Windows.Storage.ApplicationData.Current.TemporaryFolder.Path, "DebugFile.mkv");
            plist.SetDebugFile(debugFile);
#endif

            tbPlayStatus.Text = string.Empty;
            player.IsLooping  = (bool)cboxLoop.IsChecked;
            SYEngine.Core.ForceSoftwareDecode = (bool)cboxSoftDecode.IsChecked;

            player.Source = await plist.SaveAndGetFileUriAsync();
        }