Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

How can end My Youtube live stream API in c#?

$
0
0

How to stop my livestream in YouTube while completed my live telecast using c#

How to stop the livestream Using c# Code, can you please give some suggestion

string[] scopes = { "https://www.googleapis.com/auth/youtube", "https://www.googleapis.com/auth/youtube.upload" };                var creadentails = GoogleWebAuthorizationBroker.AuthorizeAsync(                        new ClientSecrets                        {                            ClientId = YTPublishSettings.PublisherClientId,                            ClientSecret = YTPublishSettings.PublisherClientSecret,                        },                        scopes, "user", default).Result;                if (creadentails.Token.IsExpired(SystemClock.Default))                    creadentails.RefreshTokenAsync(CancellationToken.None).Wait();                var secrets = new ClientSecrets                {                    ClientId = YTPublishSettings.PublisherClientId,                    ClientSecret = YTPublishSettings.PublisherClientSecret,                };                var token = new TokenResponse { RefreshToken = creadentails.Token.RefreshToken };                var credentials = new UserCredential(new GoogleAuthorizationCodeFlow(                new GoogleAuthorizationCodeFlow.Initializer { ClientSecrets = secrets }),"user", token);                var service = new YouTubeService(new BaseClientService.Initializer                {                    HttpClientInitializer = credentials,                    ApplicationName = "**************",                });                var broadcast = new LiveStream                {                    Cdn = new CdnSettings                    {                        FrameRate = "35fps",                        IngestionType = "rtmp",                        Resolution = "720p"                    },                    Snippet = new LiveStreamSnippet                    {                        Description = Description,                        Title = Title,                    },                };                var request = service.LiveStreams.Delete(YTPublishSettings.PublisherId);                var response = request.Execute();                return new YouTubeStreamDeleteStatus()                {                    success = "Deleted",                };

How can end My YouTube live stream API in c#?


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>