Example #1
0
        private void buttonNavigate_Click(object sender, EventArgs e)
        {
            if (!is_already_write_)
            {
                DialogResult result = MessageBox.Show("まだ保存されていませんが続けますか?",
                                                      "確認", MessageBoxButtons.OKCancel);
                if (result == DialogResult.Cancel)
                {
                    return;
                }
            }
            string url = comboBoxNavigateUrl.Text;

            try
            {
                current_video_id_ = NicoUtil.CutNicoVideoId(url);
            }
            catch (FormatException)
            {
                MessageBox.Show("動画IDまたはURLを入力してください。");
                return;
            }
            current_start_         = -1.0;
            current_end_           = -1.0;
            textBoxVideoStart.Text = "";
            textBoxVideoEnd.Text   = "";
            navigate_kind_         = NavigateKind.FromGo;
            is_already_write_      = false;
            timer1.Enabled         = false;
            label4.Text            = "0";
            labelInfo.Text         = "";

            webBrowser1.Navigate("http://www.nicovideo.jp/watch/" + current_video_id_);
        }
Example #2
0
        private void buttonVideoStart_Click(object sender, EventArgs e)
        {
            if (sender == buttonVideoStart)
            {
                navigate_kind_ = NavigateKind.FromStart;
                timer1.Enabled = true;
                start_time_    = DateTime.Now;
            }
            else
            {
                navigate_kind_ = NavigateKind.FromEnd;
                timer1.Enabled = false;
            }
            string url    = comboBoxNavigateUrl.Text;
            string script = "javascript:{var a=$('flvplayer').GetVariable('moved_time');var b = \"" +
                            url + "#\" + a;location.href=b;} void 0";

            webBrowser1.Navigate(script);
        }