Video modal forward and delete
This commit is contained in:
parent
a6e5aa9e40
commit
950ecd0d1d
@ -990,8 +990,34 @@ angular.module('myApp.controllers', [])
|
||||
|
||||
})
|
||||
|
||||
.controller('VideoModalController', function ($scope, AppVideoManager) {
|
||||
.controller('VideoModalController', function ($scope, $rootScope, $modalInstance, PeersSelectService, AppMessagesManager, AppVideoManager, AppPeersManager, ErrorService) {
|
||||
$scope.video = AppVideoManager.wrapForFull($scope.videoID);
|
||||
|
||||
$scope.progress = {enabled: false};
|
||||
$scope.player = {};
|
||||
|
||||
$scope.forward = function () {
|
||||
var messageID = $scope.messageID;
|
||||
PeersSelectService.selectPeer().then(function (peerString) {
|
||||
var peerID = AppPeersManager.getPeerID(peerString);
|
||||
AppMessagesManager.forwardMessages(peerID, [messageID]).then(function () {
|
||||
$rootScope.$broadcast('history_focus', {peerString: peerString});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$scope.delete = function () {
|
||||
var messageID = $scope.messageID;
|
||||
ErrorService.confirm({type: 'MESSAGE_DELETE'}).then(function () {
|
||||
AppMessagesManager.deleteMessages([messageID]);
|
||||
});
|
||||
};
|
||||
|
||||
$scope.$on('history_delete', function (e, historyUpdate) {
|
||||
if (historyUpdate.msgs[$scope.messageID]) {
|
||||
$modalInstance.dismiss();
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
.controller('UserModalController', function ($scope, $location, $rootScope, $modal, AppUsersManager, NotificationsManager, AppMessagesManager, AppPeersManager, PeersSelectService, ErrorService) {
|
||||
|
@ -2185,11 +2185,10 @@ angular.module('myApp.services', [])
|
||||
return video;
|
||||
}
|
||||
|
||||
function openVideo (videoID, accessHash) {
|
||||
function openVideo (videoID, messageID) {
|
||||
var scope = $rootScope.$new(true);
|
||||
scope.videoID = videoID;
|
||||
scope.progress = {enabled: false};
|
||||
scope.player = {};
|
||||
scope.messageID = messageID;
|
||||
|
||||
var modalInstance = $modal.open({
|
||||
templateUrl: 'partials/video_modal.html',
|
||||
|
@ -101,7 +101,7 @@
|
||||
</a>
|
||||
|
||||
<div ng-switch-when="messageMediaVideo" class="im_message_video im_message_document_thumbed">
|
||||
<a class="im_message_video_thumb" href="" ng-click="openVideo(historyMessage.media.video.id)" bo-style="{width: historyMessage.media.video.thumb.width + 'px'}">
|
||||
<a class="im_message_video_thumb" href="" ng-click="openVideo(historyMessage.media.video.id, historyMessage.id)" bo-style="{width: historyMessage.media.video.thumb.width + 'px'}">
|
||||
<span class="im_message_video_duration" bo-bind="historyMessage.media.video.duration | duration"></span>
|
||||
<i class="icon icon-videoplay"></i>
|
||||
<img
|
||||
@ -119,7 +119,7 @@
|
||||
</div>
|
||||
<div class="im_message_document_actions" ng-if="!historyMessage.media.video.progress.enabled">
|
||||
<a href="" ng-click="downloadVideo(historyMessage.media.video.id)">Download</a>
|
||||
<a href="" ng-click="openVideo(historyMessage.media.video.id)">Play video</a>
|
||||
<a href="" ng-click="openVideo(historyMessage.media.video.id, historyMessage.id)">Play video</a>
|
||||
</div>
|
||||
<div class="clearfix cancelable_progress_wrap" ng-if="historyMessage.media.video.progress.enabled">
|
||||
<a class="im_message_media_progress_cancel pull-right" ng-click="historyMessage.media.video.progress.cancel()">Cancel</a>
|
||||
|
Loading…
x
Reference in New Issue
Block a user