angularjs - ionic exit iframe fullscreen mode to the wrong page -
i wan't play vimeo videos in ionic app. have page display video. have iframe inside view contains player video. when click on iframe open video on fullscreen mode. when exit video should send me view contains iframe instead send me view totaly not related view. it's hierarchicaly far parent of view. here's code.
<ion-pane ng-controller="howtovideodetailctrl howtovideodetail"> <ion-header-bar class="bar bar-header bar-positive"> <button ng-click="howtovideodetail.back()" class="button button-white button-clear"><i class="icon ion-ios-arrow-left"></i> </button> <h1 class="title">{{ video.title }}</h1> </ion-header-bar> <ion-content class="has-tabs background-stable" scroll="false"> <ion-scroll> <div ng-init="howtovideodetail.initvideo()"> </div> <iframe ng-src="{{src}}" width="100%" height="360" frameborder="0" title="" webkitallowfullscreen="true" mozallowfullscreen="true" allowfullscreen="true"></iframe> <p>{{ video.description }}</p> </ion-scroll> </ion-content>
and controller
(function() { 'use strict'; angular.module('app') .controller('howtovideodetailctrl', howtovideodetailctrl); howtovideodetailctrl.$inject = ['$scope', '$stateparams', '$sce', '$ionichistory']; /** * howtovideodetail screen template controller * @param {object} $scope * @param {object} $stateparams * @param {object} $sce * @constructor */ function howtovideodetailctrl($scope, $stateparams, $sce, $ionichistory) { var howtovideodetail = this; $scope.video = $stateparams.video; $scope.src = $sce.trustasresourceurl('https://player.vimeo.com/video/' + $stateparams.video.uri.substring(8)); howtovideodetail.back = back; function back() { $ionichistory.goback(); } }
}());
Comments
Post a Comment