// Stuff here taken from WPF tutorial // https://msdn.microsoft.com/en-us/library/ms751761%28v=vs.110%29.aspx private void RunExpKai_Loaded(object sender, RoutedEventArgs e) { // Create the interop host control. System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); // Create Shockwave Flash control. AxShockwaveFlash flash = new AxShockwaveFlash(); // Assign the shockwave flash control as the host control's child. host.Child = flash; // Add the interop host control to the Grid // control's collection of child controls. this.grid_winformshost.Children.Add(host); string swf_path = System.IO.Directory.GetCurrentDirectory() + "\\api_port.swf"; flash.Location = new System.Drawing.Point(0, 0); flash.LoadMovie(0, swf_path); flash.AllowScriptAccess = "always"; this.flashproxy = new ExternalInterfaceProxy(flash); //string msg = this.flashproxy.Call("api_mission", null).ToString(); }
private void Form_Load(object sender, EventArgs e) { AxShockwaveFlash player = new AxShockwaveFlash(); player.CreateControl(); player.WMode = "transparent"; player.AllowScriptAccess = "sameDomain"; player.Loop = false; player.LoadMovie(0, @"encrypt.swf"); }
private void resetFilesToolStripMenuItem_Click(object sender, EventArgs e) { axShockwaveFlash1.Stop(); axShockwaveFlash1 = new AxShockwaveFlash(); File.Delete(".\\stinkogame.swf"); AcquireAssets aa = new AcquireAssets(); aa.ShowDialog(); string path = Directory.GetCurrentDirectory(); axShockwaveFlash1.LoadMovie(0, path + "\\stinkogame.swf"); }
private void DisplaySwf(string path) { DockContent content = MainForm.CurDocument; ScintillaControl sci = MainForm.CurSciControl; if (content.Controls.Count == 1) { AxShockwaveFlash flash = new AxShockwaveFlash(); flash.FSCommand += new _IShockwaveFlashEvents_FSCommandEventHandler(flash_FSCommand); flash.Dock = DockStyle.Fill; sci.Visible = false; sci.IsReadOnly = true; sci.Enabled = false; content.Controls.Add(flash); flash.LoadMovie(0, path); } }
private void PopupSwf(string path, int width, int height) { PopupViewer viewer = new PopupViewer(); viewer.Text = Path.GetFileName(path) + " - Player"; viewer.Icon = playerIcon; viewer.ClientSize = new Size(width, height); viewer.Location = MainForm.CommandBarManager.Parent.Location; viewer.Left += 6 + 15; viewer.Top += 111 + 15; AxShockwaveFlash flash = new AxShockwaveFlash(); flash.FSCommand += new _IShockwaveFlashEvents_FSCommandEventHandler(flash_FSCommand); flash.Dock = DockStyle.Fill; viewer.Controls.Add(flash); viewer.Show(); flash.LoadMovie(0, path); }
public async void Initialize(VideoData videoData) { while (!IsPreIntialized) { Thread.Sleep(1); } VideoData = videoData; //ロードに失敗したら if (VideoData.ApiData == null) { Owner.LoadFailed = true; Owner.IsActive = false; Owner.Status = "動画の読み込みに失敗しました。"; return; } Owner.Name = VideoData.ApiData.Title; //有料動画なら if (VideoData.ApiData.IsPaidVideo) { App.ViewModelRoot.Messenger.Raise(new TransitionMessage(typeof(PaidVideoDialog), Owner, TransitionMode.Modal)); return; } await DispatcherHelper.UIDispatcher.BeginInvoke(new Action(() => { Proxy.ExternalInterfaceCall += new ExternalInterfaceCallEventHandler(ExternalInterfaceHandler); if (ShockwaveFlash.IsDisposed) { return; } if (VideoData.ApiData.Cmsid.Contains("nm")) { VideoData.VideoType = NicoNicoVideoType.SWF; ShockwaveFlash.LoadMovie(0, GetNMPlayerPath()); } else if (VideoData.ApiData.GetFlv.VideoUrl.StartsWith("rtmp")) { VideoData.VideoType = NicoNicoVideoType.RTMP; ShockwaveFlash.LoadMovie(0, GetRTMPPlayerPath()); } else { if (VideoData.ApiData.MovieType == "flv") { VideoData.VideoType = NicoNicoVideoType.FLV; } else { VideoData.VideoType = NicoNicoVideoType.MP4; } ShockwaveFlash.LoadMovie(0, GetPlayerPath()); } Owner.IsActive = false; })); //動画時間 Owner.Time.VideoTimeString = NicoNicoUtil.ConvertTime(VideoData.ApiData.Length); Owner.Time.Length = VideoData.ApiData.Length; if (VideoData.ApiData.GetFlv.IsPremium && !VideoData.ApiData.GetFlv.VideoUrl.StartsWith("rtmp")) { Owner.StoryBoardStatus = "取得中"; var sb = new NicoNicoStoryBoard(VideoData.ApiData.GetFlv.VideoUrl); VideoData.StoryBoardData = sb.GetStoryBoardData(); if (VideoData.StoryBoardData == null) { Owner.StoryBoardStatus = "データ無し"; } else { Owner.StoryBoardStatus = "取得完了"; } } else { Owner.StoryBoardStatus = "データ無し"; } Owner.CommentInstance = new NicoNicoComment(VideoData.ApiData, Owner); InitializeComment(); }
///<summary> /// Member functions. ///</summary> public void LoadFlashAnimation(AxShockwaveFlash ObjShockwaveFlash, string path) { Path = System.Environment.CurrentDirectory; Path += path; ObjShockwaveFlash.LoadMovie(0, Path); }
public void LoadMovie() { ShockwaveFlash.LoadMovie(0, Directory.GetCurrentDirectory() + "./Flash/NicoNicoLivePlayer.swf"); Proxy.ExternalInterfaceCall += new ExternalInterfaceCallEventHandler(ExternalInterfaceHandler); }