private void IninitFlashComponent() { try { _flash = new AxShockwaveFlashObjects.AxShockwaveFlash(); _flash.BeginInit(); _flash.EndInit(); FormHost.Child = _flash; _flash.Visible = false; //_flash.WMode = "transparent"; //_flash.Loop = true; _flash.OnReadyStateChange += new AxShockwaveFlashObjects._IShockwaveFlashEvents_OnReadyStateChangeEventHandler(_flash_OnReadyStateChange); } catch (Exception ex) { LogProcessorService.Log.UIService.LogError("Ininit Flash Component Failed. ", ex); } }
private void LoadSwf() { if (playing) { this.Controls.Remove(axFlash); axFlash.Dispose(); } axFlash = new AxShockwaveFlashObjects.AxShockwaveFlash(); axFlash.BeginInit(); axFlash.Location = new Point(0, 0); axFlash.Name = "Main"; axFlash.TabIndex = 0; ResizeGameWindow(); axFlash.EndInit(); this.Controls.Add(axFlash); axFlash.WMode = "Direct"; // axFlash.ScaleMode = 1; axFlash.SetVariable("quality", "Medium"); axFlash.Quality = quality; axFlash.LoadMovie(0, protocol + "://s" + server + "-ddt.7tgames.com//" + GetSwfUrl(session)); axFlash.DisableLocalSecurity(); }
/// <summary> /// Changes the channel to the selected channel given. /// </summary> private void ChannelSelected(string name) { _currentChannel = name; TitleProcessor(); this.flashPanel.Controls.Remove(flashPlayer); flashPlayer.Dispose(); flashPlayer = new AxShockwaveFlashObjects.AxShockwaveFlash(); flashPlayer.BeginInit(); flashPlayer.Name = "flashPlayer"; flashPlayer.EndInit(); this.flashPanel.Controls.Add(flashPlayer); flashPlayer.WMode = "Direct"; flashPlayer.EmbedMovie = false; flashPlayer.AllowNetworking = "all"; flashPlayer.AllowScriptAccess = "always"; flashPlayer.FlashVars = "hostname=www.twitch.tv&channel=" + name + "&auto_play=true&start_volume=100"; flashPlayer.LoadMovie(0, "http://www.twitch.tv/widgets/live_embed_player.swf"); FlashPanelResize(null,null); this.chatPanel.DocumentText = "<html><head></head><body style=\"margin: 0px; padding 0px; width: 350px; \"><iframe frameborder=\"0\" scrolling=\"no\" id=\"chat_embed\" src=\"http://twitch.tv/chat/embed?channel=" + name + "&popout_chat=true\" height=\"100%\" width=\"350\"></iframe></body></html>"; // Create a channel object to do all of the Twitch API stuff. if (_channel != null) { _channel.Dispose(); } _channel = new Channel(Properties.Resources.icon); _channel.Loaded += ChannelLoaded; _channel.GameChanged += GameChanged; _channel.Initialise(name); }