Question

I want to show my remote images (coming from web service or remote URL). the default images shown in kitchensink app, are the saved Photos. I want to place the remote URL photos instead of Saved photos. Please anyone explain it that what changes I can make using Titanium.Media.openPhotoGallery This is example code for kitchensink app.

Titanium.Media.openPhotoGallery({

    success : function(event) {
        var cropRect = event.cropRect;
        var image = event.media;

        // set image view
        Ti.API.debug('Our type was: ' + event.mediaType);
        if(event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {
            imageView.image = image;
        } else {
            // is this necessary?
        }

        Titanium.API.info('PHOTO GALLERY SUCCESS cropRect.x ' + cropRect.x + ' cropRect.y ' + cropRect.y + ' cropRect.height ' + cropRect.height + ' cropRect.width ' + cropRect.width);

    },
    cancel : function() {

    },
    error : function(error) {
    },
    allowEditing : true,
    popoverView : popoverView,
    arrowDirection : arrowDirection,
    mediaTypes : [Ti.Media.MEDIA_TYPE_VIDEO, Ti.Media.MEDIA_TYPE_PHOTO]
});
Was it helpful?

Solution

Unfortunately I don't think you can load in remote images with openPhotoGallery. This method is only for device photo library access. You will probably have to make a window that looks the same yourself and load in the images through imageView or xhr call.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top