Improved FxOS downloads
This commit is contained in:
parent
bf3e0ab630
commit
b69df79e85
@ -1870,6 +1870,9 @@ img.img_fullsize {
|
||||
-ms-interpolation-mode: nearest-neighbor; /* IE8+ */
|
||||
|
||||
}
|
||||
.video_full_player video {
|
||||
background: #000;
|
||||
}
|
||||
|
||||
.media_modal_info {
|
||||
color: #999;
|
||||
|
@ -1166,6 +1166,9 @@ a.mobile_modal_action .tg_checkbox_label {
|
||||
font-size: 13px;
|
||||
height: 46px;
|
||||
}
|
||||
.media_modal_top_actions .navbar-quick-media-back:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
.media_modal_top_actions .navbar-quick-media-back .icon-back {
|
||||
position: absolute;
|
||||
margin-left: -18px;
|
||||
|
@ -214,6 +214,26 @@ angular.module('izhukov.utils', [])
|
||||
window.navigator.msSaveBlob(blob, fileName);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (window.navigator && navigator.getDeviceStorage) {
|
||||
var storageName = 'sdcard';
|
||||
switch (mimeType.split('/')[0]) {
|
||||
case 'video': storageName = 'videos'; break;
|
||||
case 'audio': storageName = 'music'; break;
|
||||
case 'image': storageName = 'pictures'; break;
|
||||
}
|
||||
var deviceStorage = navigator.getDeviceStorage(storageName);
|
||||
|
||||
var request = deviceStorage.addNamed(blob, fileName);
|
||||
|
||||
request.onsuccess = function () {
|
||||
console.log('Device storage save result', this.result);
|
||||
};
|
||||
request.onerror = function () {
|
||||
};
|
||||
return;
|
||||
}
|
||||
|
||||
getFileCorrectUrl(blob, mimeType).then(function (url) {
|
||||
var anchor = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
|
||||
anchor.href = url;
|
||||
|
@ -2573,7 +2573,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
|
||||
|
||||
function saveVideoFile (videoID) {
|
||||
var video = videos[videoID],
|
||||
mimeType = video.mime_type || 'video/mpeg4',
|
||||
mimeType = video.mime_type || 'video/mp4',
|
||||
fileExt = mimeType.split('.')[1] || 'mp4',
|
||||
fileName = 't_video' + videoID + '.' + fileExt,
|
||||
historyVideo = videosForHistory[videoID] || video || {};
|
||||
|
@ -28,6 +28,22 @@
|
||||
},
|
||||
"push": {
|
||||
"description": "Required for notifications"
|
||||
},
|
||||
"device-storage:music": {
|
||||
"description": "Required for voice notes download",
|
||||
"access": "createonly"
|
||||
},
|
||||
"device-storage:pictures": {
|
||||
"description": "Required for photos download",
|
||||
"access": "createonly"
|
||||
},
|
||||
"device-storage:sdcard": {
|
||||
"description": "Required for documents download",
|
||||
"access": "createonly"
|
||||
},
|
||||
"device-storage:videos": {
|
||||
"description": "Required for videos download",
|
||||
"access": "createonly"
|
||||
}
|
||||
},
|
||||
"activities": {
|
||||
|
Loading…
Reference in New Issue
Block a user