Browse Source

Allow subscribers to control the presentation, too.

pull/70/head
Joachim Bauch 11 years ago
parent
commit
bc89dd7205
  1. 4
      static/js/directives/pdfcanvas.js
  2. 13
      static/js/directives/presentation.js
  3. 10
      static/partials/presentation.html

4
static/js/directives/pdfcanvas.js

@ -93,6 +93,10 @@ define(['require', 'underscore', 'jquery', 'pdf'], function(require, _, $, pdf)
}; };
PDFCanvas.prototype._showPage = function(page) { PDFCanvas.prototype._showPage = function(page) {
if (page === this.scope.currentPageNumber) {
return;
}
console.log("Showing page", page, "/", this.scope.maxPageNumber); console.log("Showing page", page, "/", this.scope.maxPageNumber);
if (this.currentPage) { if (this.currentPage) {
this.currentPage.destroy(); this.currentPage.destroy();

13
static/js/directives/presentation.js

@ -29,7 +29,7 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($,
$scope.layout.presentation = false; $scope.layout.presentation = false;
$scope.isPresenter = false; $scope.isPresenter = false;
$scope.hideControlsBar = false; $scope.hideControlsBar = true;
$scope.pendingPageRequest = null; $scope.pendingPageRequest = null;
$scope.presentationLoaded = false; $scope.presentationLoaded = false;
@ -180,17 +180,12 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($,
}; };
$scope.$on("pdfPageLoading", function(event, page) { $scope.$on("pdfPageLoading", function(event, page) {
if (!$scope.isPresenter) { mediaStream.webrtc.callForEachCall(function(peercall) {
return;
}
_.each(peers, function(ignore, peerId) {
var peercall = mediaStream.webrtc.findTargetCall(peerId);
mediaStream.api.apply("sendPresentation", { mediaStream.api.apply("sendPresentation", {
send: function(type, data) { send: function(type, data) {
return peercall.peerconnection.send(data); return peercall.peerconnection.send(data);
} }
})(peerId, currentToken, { })(peercall.id, currentToken, {
Type: "Page", Type: "Page",
Page: page Page: page
}); });
@ -261,6 +256,7 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($,
}); });
uploadPresentation(info); uploadPresentation(info);
$scope.isPresenter = true; $scope.isPresenter = true;
$scope.hideControlsBar = false;
$scope.$emit("openPdf", f); $scope.$emit("openPdf", f);
}, this)); }, this));
}, this)); }, this));
@ -278,6 +274,7 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($,
finishDownloadPresentation(); finishDownloadPresentation();
$scope.layout.presentation = false; $scope.layout.presentation = false;
$scope.isPresenter = false; $scope.isPresenter = false;
$scope.hideControlsBar = true;
$scope.$emit("mainview", "presentation", false); $scope.$emit("mainview", "presentation", false);
}; };

10
static/partials/presentation.html

@ -1,12 +1,12 @@
<div class="presentation"> <div class="presentation">
<div class="presentationpane nicescroll"> <div class="presentationpane nicescroll">
<pdfcanvas/> <pdfcanvas/>
</div> </div>
<div class="overlaybar form-horizontal" ng-class="{notvisible: hideControlsBar}" ng-show="isPresenter"> <div class="overlaybar form-horizontal" ng-class="{notvisible: hideControlsBar}">
<a class="overlaybar-button" ng-model="hideControlsBar" btn-checkbox btn-checkbox btn-checkbox-true="0" btn-checkbox-false="1" title="{{_('Presentation controls')}}"><i class="fa fa-cogs"></i></a> <a class="overlaybar-button" ng-model="hideControlsBar" btn-checkbox btn-checkbox btn-checkbox-true="0" btn-checkbox-false="1" title="{{_('Presentation controls')}}"><i class="fa fa-cogs"></i></a>
<form class="overlaybar-content form-group"> <form class="overlaybar-content form-group">
<a class="btn" ng-click="prevPage()" ng-show="currentPageNumber &gt; 1" title="{{_('Prev')}}"><i class="fa fa-backward"></i></a> <a class="btn" ng-click="prevPage()" ng-show="currentPageNumber &gt; 1" title="{{_('Prev')}}"><i class="fa fa-backward"></i></a>
<a class="btn" ng-click="nextPage()" ng-show="currentPageNumber &lt; maxPageNumber" title="{{_('Next')}}"><i class="fa fa-forward"></i></a> <a class="btn" ng-click="nextPage()" ng-show="currentPageNumber &lt; maxPageNumber" title="{{_('Next')}}"><i class="fa fa-forward"></i></a>
</form> </form>
</div> </div>
</div> </div>

Loading…
Cancel
Save