国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 應用 > 影音媒體 > 正文

FLV視頻類播放器全屏切換完整AS代碼示例

2024-07-15 01:57:42
字體:
來源:轉載
供稿:網友
  1. function setFullScreen() {   //fscommand("fullscreen", true);  
  2. if (_root.logoCoolRabbit._visible == false) {      if (Stage["displayState"] == "normal") {  
  3.     fscommand("fullscreen", true);       Stage["displayState"] = "fullScreen";  
  4.    } else if (Stage["displayState"] == "fullScreen") {       fscommand("fullscreen", false);  
  5.     Stage["displayState"] = "normal";      }  
  6.    rootWidth = Stage.width;        rootHeight = Stage.height;  
  7.      //復位控制欄  
  8.    clearInterval(controlBuffCoolTime);      controlBuffCoolTime = null;  
  9.    clearInterval(controlBuff);      controlBuffCool = 0;  
  10.    controlBuffEstimate = null;    
  11.    //復位標題欄      clearInterval(playTitleBuffCoolTime);  
  12.    playTitleBuffCoolTime = null;      clearInterval(playTitleBuff);  
  13.    playTitleBuffCool = 0;      playTitleBuffEstimate = null;  
  14.      //重新設置組件位置  
  15.    moduleSet();    
  16.    //重新計算和設置播放組件尺寸比      videoWidthSet = rootWidth;  
  17.    videoHeightvideoHeightSet = videoHeight/videoWidth*rootWidth;      playAllModule.playFlvWindow._width = videoWidthSet;  
  18.    playAllModule.playFlvWindow._height = videoHeightSet;      playAllModule.playFlvWindow._y = (rootHeight-playAllModule.playFlvWindow._height)/2;  
  19. }   }  
  20.   //全屏模式切換  
  21. playAllModule.controlSet.buttonFullScreen.onPress = function() {   setFullScreen();  
  22. };    
  23. //創建右鍵全屏及退出全屏菜單   //var newnewMenu:ContextMenu = new ContextMenu();  
  24. var newnewMenu:ContextMenu = new ContextMenu(menuHandler);   //隱藏右鍵的一些標準菜單  
  25. newMenu.hideBuiltInItems();   // 在右鍵菜單中加入菜單項  
  26. //var fs:ContextMenuItem = new ContextMenuItem("全屏", goFullScreen);   var fs:ContextMenuItem = new ContextMenuItem("全屏", setFullScreen);  
  27. newMenu.customItems.push(fs);   //var xfs:ContextMenuItem = new ContextMenuItem("退出全屏", exitFullScreen);  
  28. var xfs:ContextMenuItem = new ContextMenuItem("退出全屏", setFullScreen);   newMenu.customItems.push(xfs);  
  29. // 現在將右鍵菜單指定給場景中的movieclip.我當前指定給場景中的box.你也可以指定給_root   this.menu = newMenu;  
  30.   /**  
  31. function goFullScreen() {   //Stage["displayState"] = "fullScreen";  
  32. }   function exitFullScreen() {  
  33. //Stage["displayState"] = "normal";   }  
  34. **/    
  35. // 定義開啟和關閉全屏功能,取決于你當前處于哪一種狀態下   function menuHandler(obj, menuObj) {  
  36. if (Stage["displayState"] == "normal") {      // 如果你當前處在正常模式下,則goFullscreen可點擊  
  37.    menuObj.customItems[0].enabled = true;      menuObj.customItems[1].enabled = false;  
  38. } else {      // 如果你當前片在全屏模式下,則exitFullScreen可點擊  
  39.    menuObj.customItems[0].enabled = false;      menuObj.customItems[1].enabled = true;  
  40. }   } 
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 泸西县| 翁牛特旗| 东光县| 蓝田县| 本溪市| 文昌市| 吉木萨尔县| 武城县| 克拉玛依市| 乐陵市| 怀宁县| 襄城县| 阳春市| 竹溪县| 来安县| 青海省| 嘉定区| 顺义区| 闻喜县| 林州市| 吴忠市| 东方市| 区。| 泽州县| 伊春市| 铜鼓县| 湟源县| 健康| 东平县| 武陟县| 芜湖县| 曲靖市| 安化县| 信丰县| 三门县| 基隆市| 河津市| 北安市| 宁阳县| 会昌县| 漳州市|