Source: components/camera/camera.controller.js

/**
 * @ngdoc camera
 * @name CameraCtrl
 * @module s4c.components.camera.CameraCtrl
 *
 * @description Controller do módulo de câmeras
 * 
 * 
 */
(function () {
    'use strict';

    CameraCtrl.$inject = ['$scope', '$stateParams', 'CameraService', '$sce'];

    angular.module('s4c.controllers.CameraCtrl', ['s4c.services.CameraService'])
        .controller('CameraCtrl', CameraCtrl);

     /**
      * @method CameraCtrl
      * 
      * @param {*} $scope 
      * @param {*} $stateParams 
      * @param {*} CameraService 
      * @param {*} $sce 
      */   
    function CameraCtrl($scope, $stateParams, CameraService, $sce) {
        var numero = parseInt($stateParams.id, 10);

        CameraService.pegarCamera(numero)
            .then(function (data) {
                $scope.data = data;
            });

            /**
             * @method requestFullScreen
             */
        function requestFullScreen() {

            var el = document.body;

            // Supports most browsers and their versions.
            var requestMethod = el.requestFullScreen ||
                el.webkitRequestFullScreen ||
                el.mozRequestFullScreen ||
                el.msRequestFullScreen;

            if (requestMethod) {
                // Native full screen.
                requestMethod.call(el);
            } else if (typeof window.ActiveXObject !== 'undefined') {
                // Older IE.
                var wscript = new ActiveXObject('WScript.Shell');

                if (wscript !== null) {
                    wscript.SendKeys('{F11}');
                }
            }
        }

        $scope.requestFullScreen = requestFullScreen;
        $scope.url = $sce.trustAsResourceUrl('http://geoportal.cor.rio.gov.br/geoportal/hud/servico_cameras/novowowza/player.cfm?camera=' + (numero > 200 ? 'c' : 't') + numero);
    }

}());