コード例 #1
0
        async void Skip(object sender, EventArgs e)
        {
            CrunchyrollApi.StreamDataResponse res = await crunchyrollApi.GetStreamData(medias[index + 1].iD);

            if (res.success)
            {
                await wrapper.LoadMedia(res.url, res.playhead);

                Console.WriteLine("LOG: DONELOADING");
            }
            else
            {
                if (res.message == "NoStream")
                {
                    await DisplayAlert("Couldn't get stream", "Media not available, player going to be exited", "OK");
                }
                else
                {
                    await DisplayAlert("Unknown error", "Unknown error occured, player going to be exited", "OK");
                }
                await Navigation.PopAsync();
            }
        }
コード例 #2
0
        async private void InitSource()
        {
            CrunchyrollApi.StreamDataResponse res = await crunchyApi.GetStreamData(media.iD);

            if (res.success)
            {
                Console.WriteLine("LOG: SOURCE SUCCESS");
                sourceUrl            = res.url;
                videoPlayer.Source   = VideoSource.FromUri(res.url);
                videoPlayer.Position = new TimeSpan(0, 0, res.playhead);
            }
            else
            {
                if (res.message == "NoStream")
                {
                    await DisplayAlert("Couldn't get stream", "Media not available, player going to be exited", "OK");
                }
                else
                {
                    await DisplayAlert("Unknown error", "Unknown error occured, player going to be exited", "OK");
                }
                await Navigation.PopAsync();
            }
        }