gpt4 book ai didi

c# - 如何在Xamarin.Forms中使用YouTubeRequest(可移植)

转载 作者:行者123 更新时间:2023-12-03 05:31:31 25 4
gpt4 key购买 nike

我想在用户单击Video时从我的帐户上传YouTube中的YouTube upload button,我只想知道如果必须在YouTube上发送流内容该怎么办。或者如何从流数据中获取视频路径?

string developerkey = "api_key";
YouTubeRequestSettings settings = new YouTubeRequestSettings("Sample", developerkey , "email_id", "password");
YouTubeRequest request = new YouTubeRequest(settings);

Video newVideo = new Video();
newVideo.Title = "Video Title Here || ArgeKumandan";
newVideo.Tags.Add(new MediaCategory("Autos", YouTubeNameTable.CategorySchema));
newVideo.Keywords = "cars, funny";
newVideo.Description = "My description";
newVideo.YouTubeEntry.Private = false;
newVideo.Tags.Add(new MediaCategory("mydevtag, anotherdevtag", YouTubeNameTable.DeveloperTagSchema));
newVideo.YouTubeEntry.MediaSource = new MediaFileSource(@"‪C:\Users\Yudiz\Desktop\small.mp4", "video/mp4");

var createdVideo = request.Upload(newVideo);

谢谢。

最佳答案

您似乎正在将Gdata库用于YouTube API v2.0。 Youtube v2.0 API已过时,不再起作用。

Note: The YouTube Data API (v2) has been officially deprecated as of March 4, 2014. Please refer to our deprecation policy for more information. Please use the YouTube Data API (v3) for new integrations and migrate applications still using the v2 API to the v3 API as well.



另外,您不能使用客户端登录名(登录名和密码)来访问任何Google API。您将需要使用Oauth2来访问YouTube API。

答案:您的代码将无法使用,因为您尝试访问的API不再有效。您将需要切换到使用 YouTube Data API

关于c# - 如何在Xamarin.Forms中使用YouTubeRequest(可移植),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42644640/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com