Reference iOS Sender w/ Framework API: CastVideos-ios application shows how to cast videos from an iOS device that is fully compliant with the Cast Design Checklist.
Apache License 2.0
193
stars
63
forks
source link
Cannot connect with devices to cast videos swift #123
Hello, Im trying to cast video but no success the error is showing: No devices available
Make sure Local Network Access is on(But i gave access also in AppPrivacy->LNE is ON, also im in the same wi-fi network with TV
My code in Appdelegate.swift
let options = GCKCastOptions(discoveryCriteria: GCKDiscoveryCriteria(applicationID: kReceiverAppID))
options.physicalVolumeButtonsWillControlDeviceVolume = true
/** Following code enables CastConnect */
let launchOptions = GCKLaunchOptions()
launchOptions.androidReceiverCompatible = true
options.launchOptions = launchOptions
GCKCastContext.setSharedInstanceWith(options)
Also in ViewController.swift
castButton = GCKUICastButton(frame: CGRect(x: CGFloat(0), y: CGFloat(0),
width: CGFloat(24), height: CGFloat(24)))
// Overwrite the UIAppearance theme in the AppDelegate.
castButton.tintColor = UIColor.white
navigationItem.rightBarButtonItem = UIBarButtonItem(customView: castButton)
In info.plist i added:
NSBluetoothAlwaysUsageDescription
<string>${PRODUCT_NAME} uses Bluetooth to discover nearby devices.</string>
<key>NSBonjourServices</key>
<array>
<string>_googlecast._tcp</string>
<string>_C0868879._googlecast._tcp</string>
</array>
<key>NSLocalNetworkUsageDescription</key>
<string>${PRODUCT_NAME} uses the local network to discover Cast-enabled devices on your WiFi network.</string>
Can someone let me know if someone has the same issue and what can i do?
Hello, Im trying to cast video but no success the error is showing: No devices available Make sure Local Network Access is on(But i gave access also in AppPrivacy->LNE is ON, also im in the same wi-fi network with TV
My code in Appdelegate.swift let options = GCKCastOptions(discoveryCriteria: GCKDiscoveryCriteria(applicationID: kReceiverAppID)) options.physicalVolumeButtonsWillControlDeviceVolume = true
Also in ViewController.swift castButton = GCKUICastButton(frame: CGRect(x: CGFloat(0), y: CGFloat(0), width: CGFloat(24), height: CGFloat(24))) // Overwrite the UIAppearance theme in the AppDelegate. castButton.tintColor = UIColor.white navigationItem.rightBarButtonItem = UIBarButtonItem(customView: castButton)
In info.plist i added:
Can someone let me know if someone has the same issue and what can i do?
Thank you