Bug 1297018 - disable video casting to FxOS TV while presentation API is not supported. r=ahunt. draft
authorShih-Chiang Chien <schien@mozilla.com>
Tue, 23 Aug 2016 10:30:22 +0800
changeset 404174 3a9664853864cd1692c0f67973a803395bfb1fe6
parent 403581 f97a056ae6235de7855fd8aaa04fb1c8d183bd06
child 529120 4859d0f373793f040ed88aeb433886459f0f6063
push id27143
push userschien@mozilla.com
push dateTue, 23 Aug 2016 02:42:25 +0000
reviewersahunt
bugs1297018
milestone51.0a1
Bug 1297018 - disable video casting to FxOS TV while presentation API is not supported. r=ahunt. MozReview-Commit-ID: 7ZgN0V95ob
mobile/android/chrome/content/CastingApps.js
--- a/mobile/android/chrome/content/CastingApps.js
+++ b/mobile/android/chrome/content/CastingApps.js
@@ -133,18 +133,20 @@ var CastingApps = {
     // Register targets
     SimpleServiceDiscovery.registerDevice(rokuDevice);
 
     // MediaPlayerDevice will notify us any time the native device list changes.
     mediaPlayerDevice.init();
     SimpleServiceDiscovery.registerDevice(mediaPlayerDevice);
 
     // Presentation Device will notify us any time the available device list changes.
-    fxOSTVDevice.init();
-    SimpleServiceDiscovery.registerDevice(fxOSTVDevice);
+    if (window.PresentationRequest) {
+      fxOSTVDevice.init();
+      SimpleServiceDiscovery.registerDevice(fxOSTVDevice);
+    }
 
     // Search for devices continuously
     SimpleServiceDiscovery.search(this._interval);
 
     this._castMenuId = NativeWindow.contextmenus.add(
       Strings.browser.GetStringFromName("contextmenu.sendToDevice"),
       this.filterCast,
       this.handleContextMenu.bind(this)