コード例 #1
0
 /*
  * 客户端消息接收并处理
  */
 private void Client_ReceiveMsgEvent(VideoControlMessage msg)
 {
     // Console.WriteLine(currDControl.id + "_" + msg.id + ":" + msg.message);
     if (currDControl.id == msg.id)
     {
         return;
     }
     //1.某个视频切换为播放
     //暂停当前视频
     if (msg.message == "play")
     {
         Video_Pause_ByMessage();
     }
     //2.某个视频切换为关闭了
     //背景音乐如果是自动播放,则恢复播放
     else if (msg.message == "pause")
     {
     }
     //3、打开全屏视频,
     //暂停当前视频
     //背景音乐按钮隐藏,并暂停播放
     else if (msg.message == "fullScreenEnter")
     {
         //Video_Pause_ByMessage();
     }
     //4.关闭全屏视频,背景音乐按钮显示,如果是自动播放,则恢复播放
     else if (msg.message == "fullScreenExit")
     {
     }
 }
コード例 #2
0
 public void SendMsg(VideoControlMessage msg)
 {
     if (sendMsgEvent != null)
     {
         sendMsgEvent(msg);
     }
 }
 /*
  * 客户端消息接收并处理
  */
 private void Client_ReceiveMsgEvent(VideoControlMessage msg)
 {
     Console.WriteLine("musicClient_ReceiveMsgEvent:" + msg.id + "__" + msg.message);
     if (0 == msg.id)
     {
         return;
     }
     if (!this.screenCfg.isPrimary)
     {
         return;
     }
     if (!App.localStorage.cfg.backgroundMusicShow)
     {
         return;
     }
     //1.某个视频切换为播放
     //暂停当前视频
     if (msg.message == "play")
     {
         musicPause_ByMessage();
     }
     //2.某个视频切换为关闭了
     //背景音乐如果是自动播放,则恢复播放
     else if (msg.message == "pause")
     {
         Boolean b = (Boolean)musicButton.Tag;
         if (b)
         {
             musicPlay_ByMessage();
         }
     }
     //3、打开全屏视频并播放
     //暂停当前视频
     //背景音乐按钮隐藏,并暂停播放
     else if (msg.message == "fullScreenEnter")
     {
         // musicPause_ByMessage();
         musicButton.Visibility = Visibility.Collapsed;
     }
     //4.退出全屏视频
     //背景音乐按钮显示,如果是自动播放,则恢复播放
     else if (msg.message == "fullScreenExit")
     {
         musicButton.Visibility = Visibility.Visible;
     }
 }