Bug 1297018 - disable video casting to FxOS TV while presentation API is not supported. r=ahunt.
MozReview-Commit-ID: 7ZgN0V95ob
--- 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)