Audio player design
Now showing documents names in conversations list and in notifications
This commit is contained in:
parent
bf00606f8d
commit
4638cbae51
@ -1545,11 +1545,11 @@ img.im_message_document_thumb {
|
|||||||
}
|
}
|
||||||
.tg_play_progress {
|
.tg_play_progress {
|
||||||
background: #e4e9ed;
|
background: #e4e9ed;
|
||||||
border-radius: 2px;
|
border-radius: 1px;
|
||||||
}
|
}
|
||||||
.tg_play_progress .progress-bar {
|
.tg_play_progress .progress-bar {
|
||||||
background: #628fb2;
|
background: #628fb2;
|
||||||
border-radius: 2px;
|
border-radius: 1px;
|
||||||
/*-webkit-transition: width 1s linear;
|
/*-webkit-transition: width 1s linear;
|
||||||
transition: width 1s linear;*/
|
transition: width 1s linear;*/
|
||||||
-webkit-transition: none;
|
-webkit-transition: none;
|
||||||
|
@ -1824,6 +1824,8 @@ angular.module('myApp.directives', ['myApp.filters'])
|
|||||||
|
|
||||||
.directive('myAudioPlayer', function ($sce, $timeout, $q, FileManager, MtpApiFileManager) {
|
.directive('myAudioPlayer', function ($sce, $timeout, $q, FileManager, MtpApiFileManager) {
|
||||||
|
|
||||||
|
var currentPlayer = false;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
link: link,
|
link: link,
|
||||||
scope: {
|
scope: {
|
||||||
@ -1859,6 +1861,16 @@ angular.module('myApp.directives', ['myApp.filters'])
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkPlayer (newPlayer) {
|
||||||
|
if (newPlayer === currentPlayer) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (currentPlayer) {
|
||||||
|
currentPlayer.pause();
|
||||||
|
}
|
||||||
|
currentPlayer = newPlayer;
|
||||||
|
}
|
||||||
|
|
||||||
function link($scope, element, attrs) {
|
function link($scope, element, attrs) {
|
||||||
$scope.mediaPlayer = {};
|
$scope.mediaPlayer = {};
|
||||||
|
|
||||||
@ -1872,6 +1884,7 @@ angular.module('myApp.directives', ['myApp.filters'])
|
|||||||
|
|
||||||
$scope.togglePlay = function () {
|
$scope.togglePlay = function () {
|
||||||
if ($scope.audio.url) {
|
if ($scope.audio.url) {
|
||||||
|
checkPlayer($scope.mediaPlayer.player);
|
||||||
$scope.mediaPlayer.player.playPause();
|
$scope.mediaPlayer.player.playPause();
|
||||||
}
|
}
|
||||||
else if ($scope.audio.progress && $scope.audio.progress.enabled) {
|
else if ($scope.audio.progress && $scope.audio.progress.enabled) {
|
||||||
@ -1880,6 +1893,7 @@ angular.module('myApp.directives', ['myApp.filters'])
|
|||||||
else {
|
else {
|
||||||
downloadAudio($scope.audio).then(function () {
|
downloadAudio($scope.audio).then(function () {
|
||||||
onContentLoaded(function () {
|
onContentLoaded(function () {
|
||||||
|
checkPlayer($scope.mediaPlayer.player);
|
||||||
$scope.mediaPlayer.player.play();
|
$scope.mediaPlayer.player.play();
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -1936,7 +1936,7 @@ angular.module('myApp.services', ['myApp.i18n'])
|
|||||||
switch (message.media._) {
|
switch (message.media._) {
|
||||||
case 'messageMediaPhoto': notificationMessage = _('conversation_media_photo'); break;
|
case 'messageMediaPhoto': notificationMessage = _('conversation_media_photo'); break;
|
||||||
case 'messageMediaVideo': notificationMessage = _('conversation_media_video'); break;
|
case 'messageMediaVideo': notificationMessage = _('conversation_media_video'); break;
|
||||||
case 'messageMediaDocument': notificationMessage = _('conversation_media_document'); break;
|
case 'messageMediaDocument': notificationMessage = message.media.document.file_name || _('conversation_media_document'); break;
|
||||||
case 'messageMediaAudio': notificationMessage = _('conversation_media_audio'); break;
|
case 'messageMediaAudio': notificationMessage = _('conversation_media_audio'); break;
|
||||||
case 'messageMediaGeo': notificationMessage = _('conversation_media_location'); break;
|
case 'messageMediaGeo': notificationMessage = _('conversation_media_location'); break;
|
||||||
case 'messageMediaContact': notificationMessage = _('conversation_media_contact'); break;
|
case 'messageMediaContact': notificationMessage = _('conversation_media_contact'); break;
|
||||||
|
@ -48,10 +48,10 @@
|
|||||||
></span>{{((dialogMessage.out || dialogMessage.peerID < 0) && (dialogMessage.message.length || dialogMessage.media && dialogMessage.media._ != 'messageMediaEmpty')) ? ':' : ''}}
|
></span>{{((dialogMessage.out || dialogMessage.peerID < 0) && (dialogMessage.message.length || dialogMessage.media && dialogMessage.media._ != 'messageMediaEmpty')) ? ':' : ''}}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span class="im_dialog_message_media" ng-if="dialogMessage.media && dialogMessage.media._ != 'messageMediaEmpty'" ng-switch="dialogMessage.media._">
|
<span class="im_dialog_message_media" ng-if="dialogMessage.media" ng-switch="dialogMessage.media._">
|
||||||
<span ng-switch-when="messageMediaPhoto" my-i18n="conversation_media_photo"></span>
|
<span ng-switch-when="messageMediaPhoto" my-i18n="conversation_media_photo"></span>
|
||||||
<span ng-switch-when="messageMediaVideo" my-i18n="conversation_media_video"></span>
|
<span ng-switch-when="messageMediaVideo" my-i18n="conversation_media_video"></span>
|
||||||
<span ng-switch-when="messageMediaDocument" my-i18n="conversation_media_document"></span>
|
<span ng-switch-when="messageMediaDocument" ng-bind="dialogMessage.media.document.file_name"></span>
|
||||||
<span ng-switch-when="messageMediaAudio" my-i18n="conversation_media_audio"></span>
|
<span ng-switch-when="messageMediaAudio" my-i18n="conversation_media_audio"></span>
|
||||||
<span ng-switch-when="messageMediaGeo" my-i18n="conversation_media_location"></span>
|
<span ng-switch-when="messageMediaGeo" my-i18n="conversation_media_location"></span>
|
||||||
<span ng-switch-when="messageMediaContact" my-i18n="conversation_media_contact"></span>
|
<span ng-switch-when="messageMediaContact" my-i18n="conversation_media_contact"></span>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user