angular.module("mystrom.buyswitch.controllers",["ionic"]).controller("BuySwitchController",["vidSource","$scope","$ionicHistory","$translate","settingsService","loadingService",function(e,o,n,i,a,d){o.vidSource=e,o.isAndroid=ionic.Platform.isAndroid(),o.showOverlay=!1;var t="location=yes,clearcache=yes,toolbar=no";o.goBack=function(){n.goBack()},o.goToBuyPage=function(){i("urlBuySwitch").then(function(e){window.cordova&&(a.setAnalytics("BuySwitchURL"),console.log(e),window.open(e,"_system",t))})};var r=ionic.Platform.isIPad();o.playVideo=function(){function e(){$(i).addClass("hidden"),r||$("ion-nav-bar").removeClass("hidden")}function n(){console.log("VIDEO ERROR"),d.showError(),i.load(),$(i).addClass("hidden"),r||$("ion-nav-bar").removeClass("hidden")}var i=document.getElementById("video1");return 0===i.networkState||3===i.networkState?void n():(i.addEventListener("ended",e,!1),i.addEventListener("error",n,!1),$(i).removeClass("hidden"),r||$("ion-nav-bar").addClass("hidden"),$(i).width($(".view-container").width()),$(i).height($(".view-container").height()),void(i.paused?(i.play(),o.showOverlay=!0):(i.pause(),o.showOverlay=!1)))},o.stopVideo=function(){o.showOverlay=!1;var e=document.getElementById("video1");e.pause(),e.load(),$(e).addClass("hidden"),r||$("ion-nav-bar").removeClass("hidden")}}]);