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

iOS app crashing while trying to cast m3u8 stream #226

Closed
ururus opened this issue Oct 6, 2020 · 4 comments
Closed

iOS app crashing while trying to cast m3u8 stream #226

ururus opened this issue Oct 6, 2020 · 4 comments

Comments

@ururus
Copy link

ururus commented Oct 6, 2020

Describe the bug
iOS app crashing while trying to cast m3u8 stream. I able to select and connect to chromecast device, but right after it connected it crashes. Same stream on the same screen with same parameters on android is working properly.

Code

registerGoogleCastListeners = (currentStreamUrl) => {
    const {isGoogleCastConnected} = this.state
    
    GoogleCastEvent.addListener(GoogleCast.SESSION_STARTED, () => {
      this.setState({isGoogleCastConnected: true})
      GoogleCast.castMedia({
        mediaUrl: currentStreamUrl,
      })
    })
    GoogleCastEvent.addListener(GoogleCast.SESSION_ENDED, () => {
      this.setState({isGoogleCastConnected: false})
    })
    if (!isGoogleCastConnected) {
      GoogleCastEvent.addListener(GoogleCast.MEDIA_STATUS_UPDATED, () => {
        this.setState({isGoogleCastConnected: true})
      })
    }
  }

also tried to add

contentType: 'application/vnd.apple.mpegurl',
isLive: true,

in different combinations, but still no results.

Versions:

  • RNGC Library Version: 3.2.0
  • iOS: 13.3, 14
  • 'google-cast-sdk' : 4.5.0

To Reproduce
Steps to reproduce the behavior:

  1. I able to reproduce it on any test stream for example " https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8 "
  2. Click on 'cast button'
  3. Select device
  4. See error

Expected behavior
See stream playing on chromecast device

Screenshots
IMG_1817

Full error message

ExceptionsManager.js:179 Exception '*** -[NSURL initWithString:relativeToURL:]: nil string parameter' was thrown while invoking castMedia on target RNGoogleCast with params (
{
mediaUrl = "https://lax.locastnet.org/proxy/lax/master/HcqaavPeAnSYqSujsnNero3khJRSBviDvmQ3RFEGWfe65Biz5P0LT8WoYZVIfcpPWwuAVNWWEhenWFfVlyYoXT.m3u8";
},
14396,
14397
)
callstack: (
0 CoreFoundation 0x00000001aa479128 F80FCA31-BF76-3293-8BC6-1729588AE8B6 + 1155368
1 libobjc.A.dylib 0x00000001bdc9fcb4 objc_exception_throw + 56
2 Foundation 0x00000001ab6028e0 4B7B9C0A-BAD3-348D-95A3-94784BFED02E + 59616
3 Locast 0x00000001017ef2ec -[RNGoogleCast castMedia:resolver:rejecter:] + 1420
4 CoreFoundation 0x00000001aa47d870 F80FCA31-BF76-3293-8BC6-1729588AE8B6 + 1173616
5 CoreFoundation 0x00000001aa360fd0 F80FCA31-BF76-3293-8BC6-1729588AE8B6 + 8144
6 CoreFoundation 0x00000001aa361530 F80FCA31-BF76-3293-8BC6-1729588AE8B6 + 9520
7 Locast 0x00000001014721d4 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 1880
8 Locast 0x000000010147589c _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 648
9 Locast 0x0000000101475450 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 128
10 Locast 0x00000001014753c4 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28
11 libdispatch.dylib 0x00000001aa0b1298 A564FA91-A3E3-3A41-AFD1-410FAD72E52A + 393880
12 libdispatch.dylib 0x00000001aa0b2280 A564FA91-A3E3-3A41-AFD1-410FAD72E52A + 397952
13 libdispatch.dylib 0x00000001aa08e4fc A564FA91-A3E3-3A41-AFD1-410FAD72E52A + 251132
14 libdispatch.dylib 0x00000001aa08efe8 A564FA91-A3E3-3A41-AFD1-410FAD72E52A + 253928
15 libdispatch.dylib 0x00000001aa098808 A564FA91-A3E3-3A41-AFD1-410FAD72E52A + 292872
16 libsystem_pthread.dylib 0x00000001efd5c5a4 _pthread_wqthread + 272
17 libsystem_pthread.dylib 0x00000001efd5f874 start_wqthread + 8
)
reactConsoleErrorHandler @ ExceptionsManager.js:179
n @ backend.js:32
registerError @ LogBox.js:148
errorImpl @ LogBox.js:59
console.error @ LogBox.js:33
logToConsole @ RCTLog.js:47
logIfNoNativeHook @ RCTLog.js:30
__callFunction @ MessageQueue.js:416
(anonymous) @ MessageQueue.js:109
__guard @ MessageQueue.js:364
callFunctionReturnFlushedQueue @ MessageQueue.js:108
(anonymous) @ debuggerWorker.cff11639.js:4

@phvillegas
Copy link

Hi, I using the latest version and I've the same error.

Do you've any solution?

@Jsepr
Copy link

Jsepr commented Nov 1, 2020

I had the same problem and solved it by providing an imageUrl when casting, it seems like there is no check that imageUrl is provided even though it's optional, which gives the error when it tries to parse it.

[metadata addImage:[[GCKImage alloc]
initWithURL:[[NSURL alloc] initWithString:imageUrl]
width:480
height:360]];

@hosek
Copy link

hosek commented Nov 2, 2020

Btw I can't reproduce the iOS application crash with media streams listed above, plus example app is playing m3u8 files from
example datasource without problem, so problem is probably the image mentioned above

@petrbela
Copy link
Contributor

petrbela commented Nov 3, 2020

imageUrl is now optional since 3.4.0. If there's still an issue with casting an m3u8 (HLS) stream, please comment in #93

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

5 participants