carekit-apple / CareKit

CareKit is an open source software framework for creating apps that help people better understand and manage their health.
https://www.researchandcare.org
Other
2.41k stars 443 forks source link

Adding video to OCKCarePLanActivity #131

Closed Dynami27 closed 7 years ago

Dynami27 commented 7 years ago

Any ideas how to add video to Carekit? How would I display a video on the instructions portion of care card. There is an option to add a photo through imageURL using the OCKCarePlanActivity Class but not video. I also tried extending the OCKCarePlanActivity Class, but was not successful. Thank you!!

ninoguba commented 7 years ago

You can implement your own view controller that you present in this delegate method of the OCKCareCardViewController:

http://carekit.org/docs/Protocols/OCKCareCardViewControllerDelegate.html#//api/name/careCardViewController:didSelectRowWithInterventionActivity:

Dynami27 commented 7 years ago

Where would I implement the video portion if I have video in main bundle. Sorry new iOS dev here. thanks!

umerkhan-apple commented 7 years ago

@Dynami27 You can present your own detail view controller for the activity in which you can use AVFoundation to play the video. When creating the activity, you can specify the videoURL in the userInfo dictionary for that activity.