コード例 #1
0
        public static async Task <string> PrepareMovieStreamingAsync(AvContentApiClient av, string contentUri)
        {
            var uri = await av.SetStreamingContentAsync(new PlaybackContent
            {
                Uri            = contentUri,
                RemotePlayType = RemotePlayMode.SimpleStreaming
            }).ConfigureAwait(false);

            await av.StartStreamingAsync().ConfigureAwait(false);

            return(uri.Url);
        }
コード例 #2
0
 public async Task <bool> Start(AvContentApiClient api)
 {
     try
     {
         await api.StartStreamingAsync().ConfigureAwait(false);
     }
     catch (RemoteApiException e)
     {
         DebugUtil.Log(() => { return(e.StackTrace); });
         return(false);
     }
     return(true);
 }
コード例 #3
0
ファイル: MovieStreamHelper.cs プロジェクト: locana/uwpmm
        public async Task <bool> Start(AvContentApiClient api, PlaybackContent content, string name)
        {
            if (IsProcessing)
            {
                throw new InvalidOperationException("Already processing");
            }
            AvContent = api;

            try
            {
                var location = await api.SetStreamingContentAsync(content).ConfigureAwait(false);

                await api.StartStreamingAsync().ConfigureAwait(false);

                RunLoop(false);

                var success = await StreamProcessor.OpenConnection(new Uri(location.Url)).ConfigureAwait(false);

                if (!success)
                {
                    AvContent = null;
                }

                var dispatcher = SystemUtil.GetCurrentDispatcher();
                if (dispatcher != null)
                {
                    await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                    {
                        MoviePlaybackData.FileName = name;
                    });
                }

                return(success);
            }
            catch (Exception e)
            {
                DebugUtil.Log(e.StackTrace);
                AvContent = null;
                return(false);
            }
        }
コード例 #4
0
 public static async Task StartMovieStreamingASync(AvContentApiClient av, MoviePlaybackData status)
 {
     await av.StartStreamingAsync().ConfigureAwait(false);
 }