[TIMOB-20485] LivePhoto: Proxy should override apiName
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2016-08-05T18:30:51.000+0000 |
| Affected Version/s | Release 5.2.0 |
| Fix Version/s | Release 5.4.0 |
| Components | iOS |
| Labels | ios, livephotos, qe-5.4.0 |
| Reporter | Fokke Zandbergen |
| Assignee | Hans Knöchel |
| Created | 2016-02-29T13:59:21.000+0000 |
| Updated | 2016-08-05T18:30:57.000+0000 |
Description
When I read
Ti.UI.iOS.LivePhoto.apiName it return Ti.Proxy and logs:
[ERROR] Subclasses must override the apiName API endpoint.
Which comes from:
https://github.com/appcelerator/titanium_mobile/blob/bdfbe4d530e81caf440b595351bc84bef79f27d4/iphone/Classes/TiProxy.m#L1310
PR: https://github.com/appcelerator/titanium_mobile/pull/7785
Demo:
Expected result: "Ti.UI.iOS.LivePhoto" *EDIT*: See the below demo-code with the current usage instead.*Reopening*,
Ti.API.warn(Ti.UI.iOS.LivePhoto.apiName)returns an undefined object error. *ENV**Error**App.js used*[ERROR] : Script Error { [ERROR] : column = 461; [ERROR] : line = 1; [ERROR] : message = "undefined is not an object (evaluating 'Ti.UI.iOS.LivePhoto.apiName')"; [ERROR] : sourceURL = "file:///var/containers/Bundle/Application/AE7515B1-3A96-48B8-9E63-1862B94724E5/TIMOB-20396.app/app.js"; [ERROR] : stack = "success@file:///var/containers/Bundle/Application/AE7515B1-3A96-48B8-9E63-1862B94724E5/TIMOB-20396.app/app.js:1:461"; [ERROR] : }var window = Ti.UI.createWindow({ backgroundColor: "white" }); var btn1 = Ti.UI.createButton({ title: "Select live photo!", top: 30 }); btn1.addEventListener("click", openGallery); window.add(btn1); window.open(); function openGallery() { Ti.Media.openPhotoGallery({ mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO, Ti.Media.MEDIA_TYPE_LIVEPHOTO], success: function(e) { var livePhoto = e.livePhoto // Live photo of type Ti.UI.iOS.LivePhoto if (livePhoto) { var livePhotoView = Ti.UI.iOS.createLivePhotoView({ livePhoto: livePhoto, muted: true, width: 300 }); livePhotoView.addEventListener("start", function(e) { Ti.API.warn("-- Start playback --"); Ti.API.warn(e); }); livePhotoView.addEventListener("stop", function(e) { Ti.API.warn("-- Stop playback --"); Ti.API.warn(e); }); window.add(livePhotoView); Ti.API.warn(Ti.UI.iOS.LivePhoto.apiName); } } }); }Hey Josh, sorry, my mistake in providing the test-case. Of course, we cannot check the
apiNameon the LivePhoto itself. Updated demo-code attached. Now, we log theapiNameafter a live-photo is selected from the library, which returns aTi.UI.iOS.LivePhotoinstance. Thanks! Demo:var window = Ti.UI.createWindow({ backgroundColor: "white" }); var btn1 = Ti.UI.createButton({ title: "Select live photo!", top: 30 }); btn1.addEventListener("click", openGallery); window.add(btn1); window.open(); function openGallery() { Ti.Media.openPhotoGallery({ mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO, Ti.Media.MEDIA_TYPE_LIVEPHOTO], success: function(e) { var livePhoto = e.livePhoto // Live photo of type Ti.UI.iOS.LivePhoto // Log the apiName Ti.API.warn(livePhoto.apiName); if (livePhoto) { var livePhotoView = Ti.UI.iOS.createLivePhotoView({ livePhoto: livePhoto, muted: true, width: 300 }); livePhotoView.addEventListener("start", function(e) { Ti.API.warn("-- Start playback --"); Ti.API.warn(e); }); livePhotoView.addEventListener("stop", function(e) { Ti.API.warn("-- Stop playback --"); Ti.API.warn(e); }); window.add(livePhotoView); } } }); }Verified as fixed, thanks [~hansknoechel]. Tested on:
*Closing ticket*