locked
How to use Youtube Live Streaming API ?? RRS feed

  • Question

  • I want to make a WPF application that gets the video from my ip camera and sends it to my youtube channel live. I look around all of the websites but there's no example how can i live stream a video to Youtube with c#. There are examples in google's website but they were written with PHP, Java and Phyton but I don't know this programming languages so i couldn't use the API.

    I tried to write a little bit but it didn't work. Here's my code that i wrote looking through the Java example.

            string devkey = "AIzaSyCbxm6g9orAw9PF3MkzTb_0PGbpD3Xo1Qg";
            string username = "MyYoutubeChannelEmailAdress";
            string password = "MyPassword";
    
            YouTubeRequestSettings youtubereqsetting = new YouTubeRequestSettings("API Project", devkey, username, password);
    
            YouTubeRequest youtubereq = new YouTubeRequest(youtubereqsetting);
    
            LiveBroadcastSnippet broadcastSnippet = new LiveBroadcastSnippet();
    
            broadcastSnippet.Title = "Test Live Stream";
            broadcastSnippet.ScheduledStartTime = new DateTime(2015, 3, 12, 19, 00, 00);
            broadcastSnippet.ScheduledEndTime = new DateTime(2015, 3, 12, 20, 00, 00);
    
    
            LiveBroadcastStatus status = new LiveBroadcastStatus();
            status.PrivacyStatus = "Private";
    
            LiveBroadcast broadcast = new LiveBroadcast();
    
            broadcast.Kind = "youtube#liveBroadcast";
            broadcast.Snippet = broadcastSnippet;
            broadcast.Status = status;
    
            Google.Apis.YouTube.v3.LiveBroadcastsResource.InsertRequest liveBroadcastInsert = new Google.Apis.YouTube.v3.LiveBroadcastsResource.InsertRequest(service, broadcast, "");            
            LiveBroadcast returnLiveBroadcast = liveBroadcastInsert.Execute();


    • Edited by M.Gokcen Thursday, March 12, 2015 9:10 PM
    • Moved by Kristin Xie Friday, March 13, 2015 9:26 AM question related to third-party API
    Thursday, March 12, 2015 9:10 PM

Answers