googlevr / gvr-ios-sdk

Google VR SDK for iOS
http://developers.google.com/vr/ios/
Other
645 stars 191 forks source link

Can't Observe Player Events #241

Closed ElizaSapir closed 7 years ago

ElizaSapir commented 7 years ago

Hey,

Wanted to use your SDK then found that I can't observe relevant events and know when player is playable, playing, paused, failed.

Are you using AVPlayer? and is there an option to set my own avplayer via your API?

Thanks,

Eliza

OrenMe commented 7 years ago

I think this is a valid use case. How can analytics pick up on QoS? how can custom UI be fitted when there's no indication for playback metrics. Would love to hear if someone has an idea.

Thanks.

sanjayc77 commented 7 years ago

Just updated to 1.80. This includes GVRKit cocoapod, which is also provided as sample code: See: https://github.com/googlevr/gvr-ios-sdk/blob/master/Samples/GVRKit/GVRVideoRenderer.h and the updated https://github.com/googlevr/gvr-ios-sdk/tree/master/Samples/VideoWidgetDemo sample.

GVRVideoRenderer lets you provide your own AVPlayer, which you can control yourself.

You should migrate away from GVRVideoView, as that would be deprecated in a future release.

ElizaSapir commented 7 years ago

Thanks! @sanjayc77 the sample works for me BUT there is an issue when trying to import GVRKit into swift project.

Do you have a sample that combines GVRKit and Swift?

Thanks!

sanjayc77 commented 7 years ago

Unfortunately, our samples are still ObjC.

GVRKit is also released as sample code, which you can drop in your project directly: https://github.com/googlevr/gvr-ios-sdk/tree/master/Samples/GVRKit