videoWindowControls.js
Go to the documentation of this file.
1 /*
2  *=BEGIN SONGBIRD GPL
3  *
4  * This file is part of the Songbird web player.
5  *
6  * Copyright(c) 2005-2010 POTI, Inc.
7  * http://www.songbirdnest.com
8  *
9  * This file may be licensed under the terms of of the
10  * GNU General Public License Version 2 (the ``GPL'').
11  *
12  * Software distributed under the License is distributed
13  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
14  * express or implied. See the GPL for the specific language
15  * governing rights and limitations.
16  *
17  * You should have received a copy of the GPL along with this
18  * program. If not, go to http://www.gnu.org/licenses/gpl.html
19  * or write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  *=END SONGBIRD GPL
23  */
24 
31 if (typeof(Cc) == "undefined")
32  var Cc = Components.classes;
33 if (typeof(Ci) == "undefined")
34  var Ci = Components.interfaces;
35 if (typeof(Cr) == "undefined")
36  var Cr = Components.results;
37 if (typeof(Cu) == "undefined")
38  var Cu = Components.utils;
39 
40 Cu.import("resource://app/jsmodules/DOMUtils.jsm");
41 Cu.import("resource://app/jsmodules/SBDataRemoteUtils.jsm");
42 Cu.import("resource://app/jsmodules/SBUtils.jsm");
43 
46  // Internal data
48  _mediacoreManager: null,
49 
50  _videoFullscreenDataRemote: null,
51 
53  // Getter
55 
56  get VIDEO_FULLSCREEN_DR_KEY() {
57  const dataRemoteKey = "video.fullscreen";
58  return dataRemoteKey;
59  },
60 
62  // Public Methods
64 
65  toggleFullscreen: function vcc_toggleFullscreen() {
66  this._videoFullscreenDataRemote.boolValue =
67  !this._videoFullscreenDataRemote.boolValue;
68  },
69 
71  // Init/Shutdown
73 
74  _initialize: function vcc__initialize() {
75  this._mediacoreManager =
76  Cc["@songbirdnest.com/Songbird/Mediacore/Manager;1"]
77  .getService(Ci.sbIMediacoreManager);
78  this._videoFullscreenDataRemote =
79  SBNewDataRemote(this.VIDEO_FULLSCREEN_DR_KEY);
80 
81  var useTransparentGraphics = true;
82  if ("@songbirdnest.com/Songbird/WindowChromeService;1" in Cc) {
83  var winChromeService =
84  Cc["@songbirdnest.com/Songbird/WindowChromeService;1"]
85  .getService(Ci.sbIWindowChromeService);
86  useTransparentGraphics = winChromeService.isCompositionEnabled;
87  }
88 
89  if (useTransparentGraphics) {
90  var osdWindow = document.getElementById("video_osd_controls_win");
91  osdWindow.setAttribute("transparent", true);
92  }
93  },
94 
95  _shutdown: function vcc__shutdown() {
96  this._mediacoreManager = null;
97  this._videoFullscreenDataRemote = null;
98  }
99 };
const Cu
const Cc
function SBNewDataRemote(aKey, aRoot)
Create a new data remote object.
return null
Definition: FeedWriter.js:1143
const Cr
const Ci
var videoControlsController