示例#1
0
        //開啟播放介面
        private void button5_Click(object sender, EventArgs e)
        {
            //  播放界面 playInterface = new 播放界面();
            //      SearchPage   searchPage =new SearchPage();
            //      searchPage.Show();
            //     searchPage.setForm(this);

            currentPlay = 0;        //從第一首開始播放
            nowPlay     = playlistId[currentPlay];


            if (playingTrue == 0)
            {
                playInterface = new 播放界面(this);
                playInterface.setForm(this);
                playInterface.Show();


                playInterface.axShockwaveFlash1.Movie = "https://youtube.googleapis.com/v/" + nowPlay + "?autoplay=1&version=3&enablejsapi=1";

                try
                {
                    string x = playInterface.axShockwaveFlash1.CallFunction("<invoke name=\"playVideo\" returntype=\"xml\"></invoke>");
                }
                catch
                {
                }

                button5.Text = "關閉";

                playingTrue = 1;
                // playingTrue = ++;
            }
            else
            {
                playInterface.Close();
                //   playInterface.Hide();
                //   playInterface.Controls.Clear();

                button5.Text = "播放";
                playingTrue  = 0;
            }


            //重整撥放清單
        }
示例#2
0
        //開啟播放介面
        private void button5_Click(object sender, EventArgs e)
        {
          //  播放界面 playInterface = new 播放界面(); 
          //      SearchPage   searchPage =new SearchPage();
          //      searchPage.Show();
          //     searchPage.setForm(this);

            currentPlay = 0;        //從第一首開始播放
            nowPlay = playlistId[currentPlay];


            if (playingTrue==0)
            {

                playInterface = new 播放界面(this); 
                playInterface.setForm(this);
                playInterface.Show();
                

                playInterface.axShockwaveFlash1.Movie = "https://youtube.googleapis.com/v/" + nowPlay + "?autoplay=1&version=3&enablejsapi=1";

                try
                {
                    string x = playInterface.axShockwaveFlash1.CallFunction("<invoke name=\"playVideo\" returntype=\"xml\"></invoke>");
                }
                catch
                {
                }
            
                button5.Text = "關閉";

                playingTrue =1;
               // playingTrue = ++;
            }
            else
            {
                playInterface.Close();
             //   playInterface.Hide();
             //   playInterface.Controls.Clear();

                button5.Text = "播放";
                playingTrue = 0;
            }

            
            //重整撥放清單
            
        }