{ "id": "165968", "key": "TIMOB-24400", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-02-21T18:54:48.000+0000", "created": "2017-02-13T17:24:49.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "video" ], "versions": [ { "id": "18154", "name": "Release 6.0.1", "archived": false, "released": true, "releaseDate": "2016-12-21" } ], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-02-22T23:12:02.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h5. Issue description:\r\nWe want to be able to download a video file from our servers to the device and save it on the gallery (upon user's approval). On iOS we accomplish this by this code:\r\n{code}\r\nvar fileName = 'fileToDownload.mp4', \r\n saveToGalleryFlag = true, \r\n videoUrl = 'http://somedomain.com/fileToDownload.mp4';\r\n\r\nvar xhr = Titanium.Network.createHTTPClient({\r\n\t\tonload : function() {\r\n\r\n\t\t\tvar f = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, fileName);\r\n\r\n\t\t\t// write to the file\r\n\t\t\tf.write(this.responseData);\r\n\r\n\t\t\tif (saveToGalleryFlag) {\r\n\t\t\t\tvar blob = f.read();\r\n\r\n/* According to Titanium docs, this does not save Videos on Android */\r\n\t\t\t\tTitanium.Media.saveToPhotoGallery(blob, {\r\n\t\t\t\t\tsuccess : function(e) {\r\n\t\t\t\t\t\tconsole.log('-> SUCCESS');\r\n\t\t\t\t\t},\r\n\t\t\t\t\terror : function(e) {\r\n\t\t\t\t\t\tconsole.log('-> ERROR', e)\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t},\r\n\t\ttimeout : 10000\r\n\t});\r\n\r\nxhr.open('GET', videoUrl);\r\nxhr.file = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, fileName);\r\nxhr.send();\r\n{code}\r\nh5. Expected Result: \r\nDownload videos into Android gallery/ file system upon users approval.", "attachment": [], "flagged": false, "summary": "Android: Download video and save it to the Device's Gallery", "creator": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Android 6.x", "closedSprints": [ { "id": 839, "state": "closed", "name": "2017 Sprint 04 SDK", "startDate": "2017-02-12T23:36:00.961Z", "endDate": "2017-02-26T23:36:00.000Z", "completeDate": "2017-02-26T17:38:54.172Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "406973", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/8837", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-02-14T13:07:52.000+0000", "updated": "2017-02-14T13:07:52.000+0000" }, { "id": "407635", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the new feature in SDK 6.1.0.v20170222102258. \r\nWorks as expected.\r\n\r\nClosing.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-02-22T23:11:51.000+0000", "updated": "2017-02-22T23:11:51.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }