public override bool Equals(object obj) { if (obj is Player) { return(PlayerID.Equals((obj as Player).PlayerID)); } return(base.Equals(obj)); }
/// <summary> /// Creates the JavaScript block and Flash div controls and adds them to the page /// </summary> protected override void CreateChildControls() { //Add the flash content panel to the page this.Controls.Clear(); Panel vp = new Panel(); vp.ID = this.ClientID; this.Controls.Add(vp); if (!VideoID.Equals(-1) || !PlayerID.Equals(-1)) { //wmode WMode qWMode = BrightcoveSDK.WMode.Transparent; if (WMode.Equals(BrightcoveSDK.WMode.Opaque.ToString().ToLower())) { qWMode = BrightcoveSDK.WMode.Opaque; } if (WMode.Equals(BrightcoveSDK.WMode.Window.ToString().ToLower())) { qWMode = BrightcoveSDK.WMode.Window; } string uniqueID = "video_" + DateTime.Now.ToString("yyyy.MM.dd.HH.mm.ss.FFFF"); Literal litScript = new Literal(); if (PlaylistTabs.Any()) { litScript.Text = EmbedCode.GetTabbedPlayerEmbedCode(PlayerID, VideoID, PlaylistTabs.GetValues(), Height, Width, BackColor, AutoStart, qWMode, uniqueID); } else if (PlaylistCombos.Any()) { litScript.Text = EmbedCode.GetComboBoxPlayerEmbedCode(PlayerID, VideoID, PlaylistCombos.GetValues(), Height, Width, BackColor, AutoStart, qWMode, uniqueID); } else if (VideoList != -1) { EmbedCode.GetVideoListPlayerEmbedCode(PlayerID, VideoID, VideoList, Height, Width, BackColor, AutoStart, qWMode, uniqueID); } else { litScript.Text = EmbedCode.GetVideoPlayerEmbedCode(PlayerID, VideoID, Height, Width, BackColor, AutoStart, qWMode, uniqueID); } Controls.Add(litScript); } }
protected override void AddAttributesToRender(System.Web.UI.HtmlTextWriter writer) { // Wire up the onkeypress event handler to the ChangeBackgroundColor() JavaScript function Control c = Page.FindControl(ControlToManage); StringBuilder onClickCall = new StringBuilder(); //make sure it's the right object if (c != null && c.GetType().ToString().Equals("BrightcoveSDK.UI.VideoPlayer")) { VideoPlayer vp = (VideoPlayer)c; //check video id if (VideoID.Equals(-1)) { onClickCall.Append(vp.VideoID); } else { onClickCall.Append(VideoID); } onClickCall.Append(", "); //check for player id if (PlayerID.Equals(-1)) { onClickCall.Append(vp.PlayerID); } else { onClickCall.Append(PlayerID); } //check for player name onClickCall.Append(", '" + vp.PlayerName + "', "); //check for auto start if (AutoStart.Equals(false)) { onClickCall.Append(vp.AutoStart.ToString().ToLower()); } else { onClickCall.Append(AutoStart.ToString().ToLower()); } onClickCall.Append(", '"); //check for back color if (BackColor.Equals("#000000")) { onClickCall.Append(vp.BackColor); } else { onClickCall.Append(BackColor); } onClickCall.Append("', "); //check for width if (Width.Equals(0)) { onClickCall.Append(vp.Width.ToString()); } else { onClickCall.Append(Width.ToString()); } onClickCall.Append(", "); //check for Height if (Height.Equals(0)) { onClickCall.Append(vp.Height.ToString()); } else { onClickCall.Append(Height.ToString()); } onClickCall.Append(", "); //check for IsVid if (IsVid.Equals(true)) { onClickCall.Append(vp.IsVid.ToString().ToLower()); } else { onClickCall.Append(IsVid.ToString().ToLower()); } onClickCall.Append(", '"); //check for WMode if (WMode.Equals("")) { onClickCall.Append(vp.WMode); } else { onClickCall.Append(WMode); } //append for ClientID onClickCall.Append("', '" + vp.ClientID + "', '" + PlaylistTabString + "', '" + PlaylistComboString + "', '" + VideoList.ToString() + "'"); writer.AddAttribute("onclick", "javascript:addPlayer(" + onClickCall.ToString() + ");return false;"); base.AddAttributesToRender(writer); } else { StringBuilder error = new StringBuilder(); error.Append("The ControlToManage must be specified or point to a valid VideoPlayer."); if (c == null) { error.Append("\n The ControlToManage was null."); } else if (!c.GetType().ToString().Equals("BrightcoveSDK.UI.VideoPlayer")) { error.Append("\n The ControlToManage type was " + c.GetType().ToString() + "."); } throw new ArgumentException(error.ToString()); } }
private bool IsEqual(GKPlayer other) { return(PlayerID.Equals(other.PlayerID)); }
protected bool Equals(DeviceInfo other) { return(PlayerID.Equals(other.PlayerID) && LastErrTime.Equals(other.LastErrTime) && LastWarnTime.Equals(other.LastWarnTime)); }