Here is the problem. I use Angular JS + Phonegap for the iPad application, and I try to stay on the same path when on the page after closing the modal window with the video embedded in it.
Initially, the problem was that the video did not stop playing after closing the modal window, so I added the onTouchStart event for closeWindow() as follows:
<div class="modal-youtube" ng-class="{visible: modalActive}"> <a class="close" href="#/mypage/#" eat-click ng-click="closeVideo()" onTouchStart="closeVideo()"></a> <iframe width="560" height="315" ng-show="youtubeLink" ng-src="{{youtubeLink}}" frameborder="0" allowfullscreen></iframe> </div>
This works to stop the video when closing, but when closing the video, now it wants to go to the home page. I changed href="#" to what is now - href="#/mypage/# , to at least stay on the page that I want to be, but not in the same route.
For example, I have several different videos on separate routes or URLs, for example: # / mypage / product1, # / mypage / product3, # / mypage / product6
Here are the options for playing and closing videos:
$scope.youtubeLink = null; $scope.modalActive = false; $scope.playVideo = function() { $scope.youtubeLink = angular.copy($scope.product.youtube); $scope.modalActive = true; }; $scope.closeVideo = function() { $scope.youtubeLink = null; $scope.modalActive = false; };
Any fix or help is appreciated!
javascript angularjs ipad cordova
Paul Jul 18 '13 at 0:52 2013-07-18 00:52
source share