// -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*- /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ "use strict"; this.EXPORTED_SYMBOLS = ["CastingApps"]; const { classes: Cc, interfaces: Ci, utils: Cu } = Components; Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/SimpleServiceDiscovery.jsm"); var CastingApps = { _sendEventToVideo: function (element, data) { let event = element.ownerDocument.createEvent("CustomEvent"); event.initCustomEvent("media-videoCasting", false, true, JSON.stringify(data)); element.dispatchEvent(event); }, makeURI: function (url, charset, baseURI) { return Services.io.newURI(url, charset, baseURI); }, getVideo: function (element) { if (!element) { return null; } let extensions = SimpleServiceDiscovery.getSupportedExtensions(); let types = SimpleServiceDiscovery.getSupportedMimeTypes(); // Grab the poster attribute from the