ios - Chromecast Channels in multiple classes -
ios - Chromecast Channels in multiple classes -
i have gckcastchannel send , receive messages in app chromecast receiver file.
my biggest issue app has multiple classes different views, can send , receive messages on view casts app chromecast, although when alter views can't send messages.
i used
if (!self.devicemanager || !self.devicemanager.isconnected) { bla bla bla } else {bla bla bla}
to check if devicemanager knew if connected etc. although came saying weren't connected chromecast.
any ideas on how can send messages other classes much appreciated!
mark
the gckdevicemanager manages connection, if create new 1 isn't aware of existing session. you've got couple of options, boil downwards sharing connection object:
put devicemanager (etc.) on appdelegate in order share them between different controllers. broadly approach castvideos sample uses: https://github.com/googlecast/castvideos-ios/blob/master/classes/appdelegate.h#l24 create custom class singleton contain devicemanager, , refer other media. can follow [class sharedinstance] convention access in controller.there's give-and-take on sharing objects between classes in several other questions - illustration how share object between uiviewcontrollers on iphone?
ios chromecast
Comments
Post a Comment