コード例 #1
0
        private void LveBtn_Click(object sender, EventArgs e)
        {
            //
            // Starts live video
            //
            var fb             = new FacebookClient(Selectpage.PageAccessToken);
            var PageLiveVideos = string.Format(
                @"{0}/live_videos",
                Selectpage.PageId);
            dynamic result = fb.Post(PageLiveVideos, new { published = false });

            VideoId = result.id;

            var fbupdate = new FacebookClient(Selectpage.PageAccessToken);

            //
            // Adds video detail
            //
            fbupdate.Post(VideoId, new { title = VideoTitleTextBox.Text });
            fbupdate.Post(VideoId, new { description = VideoDescriptionTextBox.Text });
            fbupdate.Post(VideoId, new { status = "LIVE_NOW" });

            Selectvideo.VideoID = VideoId; // Sets VideoId to current video
            //
            // Update OBS json file
            //
            var     stream_key = result.stream_url.Replace("rtmp://rtmp-api.facebook.com:80/rtmp/", "");
            string  json       = File.ReadAllText(OBSLocation);
            dynamic jsonObj    = Newtonsoft.Json.JsonConvert.DeserializeObject(json);

            jsonObj["settings"]["key"] = stream_key;
            string output = Newtonsoft.Json.JsonConvert.SerializeObject(jsonObj, Newtonsoft.Json.Formatting.Indented);

            File.WriteAllText(OBSLocation, output);

            this.Close(); // close go live form

            var Videocomments = new Videocomments();

            Videocomments.ShowDialog(this); // Open videocomments with current VideoId selected
        }
コード例 #2
0
        private void ComBtn_Click(object sender, EventArgs e)
        {
            var Videocomments = new Videocomments();

            Videocomments.ShowDialog(this);
        }