apache / apache/cordova-plugin-inappbrowser
InAppBrowser does not open Youtube Links Properly
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 2.2k
- PR merge metrics
- No merged PRs in 30d
Description
I might have the same issue as @siranjeevimurugesan reported - https://github.com/apache/cordova-plugin-inappbrowser/issues/1002. And I have additional issue for iOS.
### Case Description
My application uses InAppBrowser to open app links to my app. One of the links is a YouTube link (for ex. `https://youtu.be/2Vv-BfVoq4g`). Once the link clicked, it opens the InAppBrowser and opens the youtube video. On that page, we have this "Open App"(_see image below_) button displayed and that's where the issue occurs.

Here's a sample code of implementation
`
cordova.InAppBrowser.open('https://youtu.be/2Vv-BfVoq4g', '_blank', 'location=yes,hideurlbar=yes,fullscreen=yes');
`
Android and iOS has different behavior, please check the details below.
### Android
**Current Behavior**
When clicked "Open App" button, it redirects to error page, similar to siranjeevimurugesan reported.(_ex. error below_)
`
Webpage not available
The webpage at intent://m.youtube.com/watch?v=2Vv-BfVoq4g&feature=mweb_c3_open_app_11268432&itc_campaign=mweb_c3_open_app_11268432&redirect_app_store_ios=1&app=desktop#Intent;package=com.google.android.youtube;scheme=vnd.youtube;launchFlags=268435456;end could not be loaded because:
net::ERR_UNKNOWN_URL_SCHEME
`
**Evidence**

**Expected Output**
When clicked "Open App", it should redirect to YouTube app and its actual video.
### iOS
1. When clicked "Open App", it redirects to App Store YouTube app instead of the Actual YouTube App and on the actual video. It does not redirect to actual video on the YouTube App. Also, when clicking the "Open App" button, it takes 8-10 seconds before it redirects to the App Store YouTube App.
**Evidence**
_Please don't mind the gray box at the screen as I have to hide some info_
https://github.com/apache/cordova-plugin-inappbrowser/assets/53552332/6284018b-65b4-4155-bcda-a9fdf0a392c5
**Expected Output**
When clicked "Open App", it should redirect to YouTube app and its actual video.
## Information
### Command or Code
### Environment, Platform, Device
### Version information
## Checklist
- [ ] I searched for existing GitHub issues
- [ ] I updated all Cordova tooling to most recent version
- [ ] I included all the necessary information above
Contributor guide
Research direction
Start with the provided cordova.InAppBrowser.open call and reproduce the YouTube “Open App” flow separately on Android and iOS. Trace how each platform handles the resulting intent or app-store redirect; done means the YouTube app opens directly on the requested video instead of an error page or delayed App Store redirect.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, ios, java, javascript, objective-c
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100