private void LoadSelectedPlayerSettings(OoyalaData.Players.Item player, int NewEditIndex) { CheckBox chkShowShareDigg = (CheckBox)playerGrid.Rows[NewEditIndex].FindControl("chkShowShareDigg"); CheckBox chkShowShareEmailToFriend = (CheckBox)playerGrid.Rows[NewEditIndex].FindControl("chkShowShareEmailToFriend"); CheckBox chkShowShareFacebook = (CheckBox)playerGrid.Rows[NewEditIndex].FindControl("chkShowShareFacebook"); CheckBox chkAdCountdown = (CheckBox)playerGrid.Rows[NewEditIndex].FindControl("chkAdCountdown"); CheckBox chkShowBitrateButton = (CheckBox)playerGrid.Rows[NewEditIndex].FindControl("chkShowBitrateButton"); CheckBox chkShowChannelButton = (CheckBox)playerGrid.Rows[NewEditIndex].FindControl("chkShowChannelButton"); CheckBox chkShowShareGrabEmbedCode = (CheckBox)playerGrid.Rows[NewEditIndex].FindControl("chkShowShareGrabEmbedCode"); CheckBox chkReplay = (CheckBox)playerGrid.Rows[NewEditIndex].FindControl("chkReplay"); CheckBox chkShowInfoButton = (CheckBox)playerGrid.Rows[NewEditIndex].FindControl("chkShowInfoButton"); CheckBox chkShowInfoExposeDescription = (CheckBox)playerGrid.Rows[NewEditIndex].FindControl("chkShowInfoExposeDescription"); CheckBox chkShowInfoExposeProvider = (CheckBox)playerGrid.Rows[NewEditIndex].FindControl("chkShowInfoExposeProvider"); CheckBox chkShowInfoExposeTitle = (CheckBox)playerGrid.Rows[NewEditIndex].FindControl("chkShowInfoExposeTitle"); CheckBox chkShowShareButton = (CheckBox)playerGrid.Rows[NewEditIndex].FindControl("chkShowShareButton"); CheckBox chkShowVolumeButton = (CheckBox)playerGrid.Rows[NewEditIndex].FindControl("chkShowVolumeButton"); CheckBox chkShowShareToTwitter = (CheckBox)playerGrid.Rows[NewEditIndex].FindControl("chkShowShareToTwitter"); CheckBox chkShowShareLinkURL = (CheckBox)playerGrid.Rows[NewEditIndex].FindControl("chkShowShareLinkURL"); CheckBox chkAlwaysShowScrubber = (CheckBox)playerGrid.Rows[NewEditIndex].FindControl("chkAlwaysShowScrubber"); CheckBox chkBufferOnPause = (CheckBox)playerGrid.Rows[NewEditIndex].FindControl("chkBufferOnPause"); TextBox txtplayerName = (TextBox)playerGrid.Rows[NewEditIndex].FindControl("txtplayerName"); CheckBox chkPlayerGrid = (CheckBox)playerGrid.Rows[NewEditIndex].FindControl("chkDefault"); if (chkPlayerGrid.Checked) { txtplayerName.Enabled = false; } txtplayerName.Text = player.name; if (player.ooyala_branding != null) { chkShowShareDigg.Checked = player.ooyala_branding.digg_sharing; chkShowShareEmailToFriend.Checked = player.ooyala_branding.email_sharing; chkShowShareFacebook.Checked = player.ooyala_branding.facebook_sharing; chkAdCountdown.Checked = player.ooyala_branding.show_ad_countdown; chkShowBitrateButton.Checked = player.ooyala_branding.show_bitrate_button; chkShowChannelButton.Checked = player.ooyala_branding.show_channel_button; chkShowShareGrabEmbedCode.Checked = player.ooyala_branding.show_embed_button; chkReplay.Checked = player.ooyala_branding.show_end_screen_replay_button; chkShowInfoButton.Checked = player.ooyala_branding.show_info_button; chkShowInfoExposeDescription.Checked = player.ooyala_branding.show_info_screen_description; chkShowInfoExposeProvider.Checked = player.ooyala_branding.show_info_screen_homepage_link; chkShowInfoExposeTitle.Checked = player.ooyala_branding.show_info_screen_title; chkShowShareButton.Checked = player.ooyala_branding.show_share_button; chkShowVolumeButton.Checked = player.ooyala_branding.show_volume_button; chkShowShareToTwitter.Checked = player.ooyala_branding.twitter_sharing; chkShowShareLinkURL.Checked = player.ooyala_branding.url_sharing; } if (player.scrubber != null) { chkAlwaysShowScrubber.Checked = player.scrubber.always_show; } if (player.playback != null) { chkBufferOnPause.Checked = player.playback.buffer_on_pause; } }
/// <summary> /// Update Player Settings in Ooyala using V2 API /// </summary> /// <param name="SecretKey">Backlot Secret Key</param> /// <param name="APIKey">Backlot API Key</param> /// <param name="player">Media Player Object</param> public static string EditPlayer(string SecretKey, string APIKey, OoyalaData.Players.Item player) { string jsonstr = JsonHelper.JsonSerializer<OoyalaData.Players.Item>(player); Hashtable hs = (Hashtable)JSON.JsonDecode(jsonstr); var res=OoyalaAPI.patch(SecretKey, APIKey, pathPlayer + "/" + player.id, hs); if (res != null) return res["name"].ToString(); else return null; }