Closed enfipy closed 9 months ago
It seems bridge server working. You can try some CDN url
@nguyenvanphituoc thanks for the fast reply!
So basically I tried to replace my local server URL with your example CDN URL and it didn't help.
I mean, the Video from CDN URL is working but when I try to pass it through setVideoPlayUrlBy
and get cachedVideoUrl
- it fails with this TypeError: Network request failed
if use fetch
, and this if place in Video component: {"error":{"localizedRecoverySuggestion":"","domain":"NSURLErrorDomain","localizedFailureReason":"","localizedDescription":"Could not connect to the server.","code":-1004},"target":353}
.
Here are some screenshots I made. The first one - is when I just place CDN URL in the Video component, second - is from my local running server, third and fourth - are in Safari (CDN URL also opens).
I think this might be some problem with GCDWebServer
or that it runs with Expo Development Client
. But it looks like that bridge server just doesn't accept requests.
Here's the full project with server and app (that can be installed and served by: pnpm i & pnpm dev
- but still need to install the build on simulator or phone): link. But if you prefer some Minimal Reproducible Example - I can make it too. Just let me know!
If it working, can you check NSAppTransportSecurity in info.plist, does it allow connect to http without ssl
Also, regarding this question - I created a new build with NSAppTransportSecurity
and NSAllowsLocalNetworking
set to true as in Apple Docs here. But still the same error. The "Network request failed" for url http://127.0.0.1:53902/x36xhzz/x36xhzz.m3u8?__hls_origin_url=https%3A%2F%2Ftest-streams.mux.dev%2Fx36xhzz%2Fx36xhzz.m3u8
.
I can confirm that it's working correctly when used with https (http videos still don't work but I just fall back on direct load when local). The problem was that CacheManagerProvider
was inside the react-navigation
component, when I moved it to the _layout.tsx
outside of the <Tabs>
component - it worked.
Closing issue as resolved.
Describe the bug
Added as documented in docs
CacheManagerProvider
:And verified that
BridgeServer
insideCacheManagerProvider
starts listening to the port.After that, I added the following to the Video component:
That actually gives a valid-looking url:
But the Video component produces this error with function
onError
:Expected behavior
Work as expected, as it works without caching.
Smartphone (please complete the following information):
Additional context
I haven't tested on an example without Expo SDK yet.
Question
Any ideas why this could appear?