Titanium SDK: 2.1.1、ホスト OS: Mac OS X 10.6.8、モバイル プラットフォーム: iOS 5
Titanium.Media.openPhotoGallery の成功コールバックによって返される「Blob」オブジェクトのいくつかのプロパティにアクセスできません。アクセスできないプロパティは「file」と「nativePath」ですが、「height」、「width」、「mimeType」などのプロパティにはアクセスできます。シミュレーターでテストしています。
これが私がこれまでにコーディングしたものです。
Titanium.Media.openPhotoGallery({
success : function(event) {
var image = event.media;
if (event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {
// following properties are accessible
Ti.API.info(' event.media = ' + event.media );
Ti.API.info('event.media.height = ' + event.media.height );
Ti.API.info('event.media.width = ' + event.media.width );
Ti.API.info('event.mediaType = ' + event.mediaType );
// following properties are un-accessible
Ti.API.info(' event.media.nativePath = ' + event.media.nativePath );
Ti.API.info(' event.media.file = ' + event.media.getFile() );
},
cancel : function() {},
error : function(error) {},
allowEditing : true,
mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO]
});