如何将视频上传到 YouTube [Xamarin.Forms(便携式)]

How to upload videos to YouTube [Xamarin.Forms (Portable) ]

我正在尝试将视频上传到 YouTube,但不知何故它在 Xamarin.Forms (Portable) 项目中不起作用。有什么方法可以通过 Xamarin.Forms (Portable)

上传 YouTube 中的视频吗?
var initializer = new GoogleAuthorizationCodeFlow.Initializer
{
    ClientSecrets = new ClientSecrets
    {
        ClientId = Constants.API.Google.ClientID,
        ClientSecret = Constants.API.Google.ClientSecret
    },
    Scopes = new[] { YouTubeService.Scope.Youtube }
};
var flow = new AuthorizationCodeFlow(initializer);
TokenResponse token = flow.LoadTokenAsync("user", CancellationToken.None).Result;

但每次我在 TokenResponse token 中得到 null 时,我不确定我应该传递什么来代替 flow.LoadTokenAsync("user", CancellationToken.None)

中的 user

谢谢。

正如我担心的那样 Google .Net 客户端库当前不支持 Xamarin。请查看问题:Unable to Google.Apis.Auth.PlatformServices in Xamarin.Forms

It's because GoogleWebAuthorizationBroker requires several classes from Google.Apis.Auth.PlatformServices, and Google.Apis.Auth.PlatformServices is not compatible with Xamarin.