[TIMOB-19666] iOS9.1: Support PHLivePhoto + PHLivePhotoView
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-02-16T05:45:53.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 5.2.0 |
Components | iOS |
Labels | iOS9.1, notable, photo, photogallery, qe-5.2.0 |
Reporter | Chee Kiat Ng |
Assignee | Hans Knöchel |
Created | 2015-10-05T06:17:25.000+0000 |
Updated | 2016-02-17T18:53:39.000+0000 |
Description
*Summary:*
iOS 9.1 provides a way to receive, display and share live photos using the
PHLivePhoto
related classes. A live photo is a photo, that consists of several photos taken together as frames but it still is no video. It can be displayed using the PHLivePhotoView
and managed through the PHImageManager
or UIImagePickerController
(which we use).
*Proposal:*
Summarized, our proposal should be:
* a) to support taking live photos using Ti.Media.openPhotoGallery()
method
* b) allow developers to display live photos in a new view proxy e.g. Ti.UI.iOS.LivePhoto
or directly in the existing Ti.UI.ImageView
using auto detection on the image source type.
*Documentation:*
* https://developer.apple.com/library/prerelease/ios/documentation/PhotosUI/Reference/PHLivePhotoView_Class/index.html#//apple_ref/doc/uid/TP40016582
* https://developer.apple.com/library/prerelease/ios/documentation/Photos/Reference/PHLivePhoto_Class/index.html#//apple_ref/doc/uid/TP40016581
PR pending: https://github.com/appcelerator/titanium_mobile/pull/7479 Demo (live photo view):
Demo (live photo badges):
CR and FT passed. PR merged.
[~hansknoechel], [~cng], It looks like the LivePhoto is not working with
Ti.Media.showCamera()
. Should we reopen this ticket or file a new ticket? [~jlongton], please go ahead and paste your code that exhibit this bug.[~wluu] It was an issue in my proposal which I just corrected. For now (iOS 9.1), it's not possible to capture a new live photo but only to select an existing one. The docs should state that behavior as well. As soon as Apple makes it possible to capture live photos as well, I would file a new ticket and implement it as well. Thanks!
[~hansknoechel], Okay, I'll file a doc ticket for this issue.
Reopening because with latest nightly (5.2.0.v20160211193617) I get LIVEPHOTO mediaType but no livePhoto:
This issue happens when we want to receive a LivePhoto but no
Ti.UI.LivePhotoView
is defined. Although it's an edge-case, because live photos can only used be displayed inside a view, we should fix it to prevent questions. PR (master): https://github.com/appcelerator/titanium_mobile/pull/7717 PR (5_2_X): https://github.com/appcelerator/titanium_mobile/pull/7718Considering to close the PR, since the issue is not caused by the implementation itself, but an issue when running on main thread (TIMOB-20397). [~fokkezb] as you re-opened it, what do you think?
Also, http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.iOS.LivePhotoView-method-startWithPlaybackStyle does not work and can't find the implementation as wel: https://github.com/appcelerator/titanium_mobile/search?q=startWithPlaybackStyle
Fixed docs issue
[~hansknoechel] did you test the manual start and stop? I see it triggering the start and stop events but nothing happens for a few seconds after start and then it shows only a very short part of the animation. With hint even shorter. Also, when I call stop during this it kind of freezes. It doesn't feel like it works as it should. On the PR for using
Ti.Media.MEDIA_TYPE_LIVEPHOTO
; I still think we need to fix this. I don't see why it's related to TIMOB-20397 as it's simply a matter of the LivePhoto proxy API not being included in the build if you don't also use the view.Regarding the start/stop: I was also ensure, but it looks like the native behavior, since it's not really a video so the sequence is really short (faded). The PR is still valid for making the
Ti.UI.iOS.LivePhoto
available, but the threading issues also fixed in the PR are unrelated so I would clean up the PR to only remove the#ifdef
's and fix the main-thread-related issues i the separate ticket.I've updated the 5.2.0 sample so you can see what I see. I doubt this is how it should look. You'd expect full to show the full length of the live photo and both of them not to have such a long delay before they do anything.
Got it and finally reproduced it. The methods had threading problems, I added the 1-liner to the existing PR. Also added a start/stop test to the example: https://gist.github.com/hansemannn/68252eb5c106c2552d21
Can we have a simple test case here for the new fix? QE will appreciate it. [~hansknoechel] [~fokkezb]
See Gist above :-)
[~hansknoechel] patched my SDK with he main thread fix and it works fine now.
CR and FT passed. PRs merged.