Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6888] iOS: Need to support MIME type 'application/mp4' when saving video

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionDuplicate
Resolution Date2012-02-10T10:45:43.000+0000
Affected Version/sRelease 1.8.0.1
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterStephen Tramer
AssigneeNeeraj Gupta
Created2011-12-27T11:02:51.000+0000
Updated2017-03-09T21:35:45.000+0000

Description

It appears that sometimes services return valid MPEG-4 video with the MPEG-7-only MIME type (application/mp4 instead of video/mp4), probably when the data is MPEG-47. Sample code:
var mp4_path = 'http://www.mp4point.com/downloads/f4f0ea5981b3.mp4'

download_xhr = Ti.Network.createHTTPClient();

download_xhr.onload = function() {
	Ti.API.info('lets save the file');
	Titanium.Media.saveToPhotoGallery(this.responseData, {
		success: function(e) {
			Ti.API.info("SUCCESS!");
		},
		error: function(e) {
			Ti.API.info("GALLERY ERROR: "+e.error);
		}
	});
};

download_xhr.onerror = function() {
	Logger.log ('[gallery_test:downloadMessage] onerror');
	return;
};

download_xhr.open ('GET', mp4_path);
download_xhr.send();
When fixing this bug it should be ensured that the video has the "wrong" MIME type.

Comments

  1. Stephen Tramer 2012-02-10

    Dupe of TIMOB-6915.
  2. Lee Morris 2017-03-09

    Closing ticket as duplicate.

JSON Source