Skip to content

Commit 6ecde00

Browse files
authored
Merge pull request #44 from kaltura/mobile-simulator
support mobile simulation mode
2 parents 4fee2b9 + d4d95cb commit 6ecde00

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

app/js/controllers/EditCtrl.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,15 @@ KMCMenu.controller('EditCtrl', ['$scope','$http', '$timeout','PlayerData','Playe
1313
$scope.menuOpen = true;
1414
// auto preview flag
1515
$scope.autoPreview = localStorageService.get('autoPreview') ? localStorageService.get('autoPreview')=='true' : false;
16+
$scope.simulateMobile = false;
1617
$scope.setAutoPreview = function(){
1718
localStorageService.set('autoPreview', !$scope.autoPreview);
1819
};
20+
$scope.setSimulateMobile = function(){
21+
setTimeout(function(){
22+
$scope.refreshPlayer();
23+
},0);
24+
};
1925
if (window.parent.kmc && window.parent.kmc.vars.studio.showFlashStudio === false){
2026
$(".menuFooter").css("bottom","1px");
2127
}
@@ -397,6 +403,9 @@ KMCMenu.controller('EditCtrl', ['$scope','$http', '$timeout','PlayerData','Playe
397403
if ($scope.playerData.config.enviornmentConfig && $scope.playerData.config.enviornmentConfig.localizationCode){ // support localizationCode
398404
angular.extend(flashvars, {'localizationCode': $scope.playerData.config.enviornmentConfig.localizationCode});
399405
}
406+
if ($scope.simulateMobile){
407+
angular.extend(flashvars,{'EmbedPlayer.SimulateMobile': true});
408+
}
400409
delete $scope.playerData.config.enviornmentConfig;
401410
angular.extend(flashvars,{'jsonConfig': angular.toJson($scope.playerData.config)}); // update the player with the new configuration
402411
if (window.parent.kmc && window.parent.kmc.vars.ks){
@@ -421,7 +430,7 @@ KMCMenu.controller('EditCtrl', ['$scope','$http', '$timeout','PlayerData','Playe
421430
}
422431

423432
// set editable uivars list
424-
$scope.excludedUiVars = ['autoPlay', 'autoMute', 'adsOnReplay', 'enableTooltips','EmbedPlayer.SimulateMobile']; // these uiVars are already in the menu, do not list them
433+
$scope.excludedUiVars = ['autoPlay', 'autoMute', 'adsOnReplay', 'enableTooltips', 'EmbedPlayer.EnableMobileSkin']; // these uiVars are already in the menu, do not list them
425434
$scope.playerData.vars = [];
426435
var uivar;
427436
for (uivar in $scope.playerData.config.uiVars){

app/view/edit.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<div style="height: 100%"> <form name="menuForm"> <div class="menu" ng-style="menuOpen ? {'width': 440 +'px'} : {'width': 10 + 'px'}"> <div ng-repeat="category in menuData" ng-include="'templates/category.html'"></div> <div class="categories"> <div ng-repeat="category in menuData" ng-include="'templates/categoryIcon.html'"></div> </div> <div class="menuFooter"></div> </div> <div class="toggleMenu" ng-click="toggleMenu()" ng-style="menuOpen ? {'left': 439 +'px'} : {'left': 10 + 'px'}"> <i ng-class="{'icon-Close': menuOpen,'icon-open': !menuOpen}"></i> </div> </form> <div class="previewArea" ng-style="menuOpen ? {'margin-left': 490 +'px'} : {'margin-left': 50 + 'px'}"> <div style="width: 100%; height: 40px"> <div style="height: 30px; position: fixed; padding-top: 5px"> <label style="font-weight: normal" class="autoPreview"><input style="margin-right: 5px; " type="checkbox" ng-model="autoPreview" ng-click="setAutoPreview()">Auto Preview</label> </div> <button class="btn btn-default" style="margin-left: 120px" ng-hide="autoPreview" ng-class="{'btn-success':checkPlayerRefresh()}" ng-click="refreshPlayer()"><i class="glyphicon glyphicon-refresh">&nbsp;</i>Preview Changes</button> <button class="btn btn-primary pull-right spaceLeft" ng-click="save()">Save Player Settings</button> <button class="btn btn-default pull-right" ng-click="backToList()">Back to Players List</button> </div> <!--pre id="debugger" style="margin-top: 10px; width: 100%; height: 500px; display: none">{{menuData}}</pre--> <div style="height: 85%; margin-top: 15px; margin-bottom: 15px; overflow-y: auto"> <!-- Companion placeholders for VAST --> <div id="Comp_300x250"></div> <div id="Comp_728x90"></div> <div id="kVideoTarget" style="margin: auto" itemprop="video" itemscope itemtype="http://schema.org/VideoObject"></div> </div> </div></div>
1+
<div style="height: 100%"> <form name="menuForm"> <div class="menu" ng-style="menuOpen ? {'width': 440 +'px'} : {'width': 10 + 'px'}"> <div ng-repeat="category in menuData" ng-include="'templates/category.html'"></div> <div class="categories"> <div ng-repeat="category in menuData" ng-include="'templates/categoryIcon.html'"></div> </div> <div class="menuFooter"></div> </div> <div class="toggleMenu" ng-click="toggleMenu()" ng-style="menuOpen ? {'left': 439 +'px'} : {'left': 10 + 'px'}"> <i ng-class="{'icon-Close': menuOpen,'icon-open': !menuOpen}"></i> </div> </form> <div class="previewArea" ng-style="menuOpen ? {'margin-left': 490 +'px'} : {'margin-left': 50 + 'px'}"> <div style="width: 100%; height: 40px"> <div style="height: 30px; position: fixed; padding-top: 5px"> <label style="font-weight: normal" class="autoPreview"><input style="margin-right: 5px; " type="checkbox" ng-model="autoPreview" ng-click="setAutoPreview()">Auto Preview</label> <label style="font-weight: normal" class="autoPreview"><input style="margin-right: 5px;margin-left: 5px " type="checkbox" ng-model="simulateMobile" ng-click="setSimulateMobile()">Simulate Mobile Device</label> </div> <button class="btn btn-default" style="margin-left: 290px" ng-hide="autoPreview" ng-class="{'btn-success':checkPlayerRefresh()}" ng-click="refreshPlayer()"><i class="glyphicon glyphicon-refresh">&nbsp;</i>Preview Changes</button> <button class="btn btn-primary pull-right spaceLeft" ng-click="save()">Save Player Settings</button> <button class="btn btn-default pull-right" ng-click="backToList()">Back to Players List</button> </div> <!--pre id="debugger" style="margin-top: 10px; width: 100%; height: 500px; display: none">{{menuData}}</pre--> <div style="height: 85%; margin-top: 15px; margin-bottom: 15px; overflow-y: auto"> <!-- Companion placeholders for VAST --> <div id="Comp_300x250"></div> <div id="Comp_728x90"></div> <div id="kVideoTarget" style="margin: auto" itemprop="video" itemscope itemtype="http://schema.org/VideoObject"></div> </div> </div></div>

0 commit comments

Comments
 (0)