Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect with devices to cast videos swift #123

Open
shmiftari opened this issue Oct 26, 2022 · 1 comment
Open

Cannot connect with devices to cast videos swift #123

shmiftari opened this issue Oct 26, 2022 · 1 comment

Comments

@shmiftari
Copy link

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
${PRODUCT_NAME} uses Bluetooth to discover nearby devices.
NSBonjourServices

_googlecast._tcp
_C0868879._googlecast._tcp

NSLocalNetworkUsageDescription
${PRODUCT_NAME} uses the local network to discover Cast-enabled devices on your WiFi network.

Can someone let me know if someone has the same issue and what can i do?

Thank you

@shmiftari
Copy link
Author

Also i will attach screenshot
![Screenshot 2022-10-26 at 3 13 20 PM](https://user-images.githubusercontent.com/25005908/198035163-9aaf700d-63f2-42f7-9bf9-951f00c71ac8.
Screenshot 2022-10-26 at 3 13 04 PM
png)
Screenshot 2022-10-26 at 3 12 47 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant