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

The video readStream can not be played over the network #2643

Closed
wangaiyong opened this issue Apr 18, 2022 · 1 comment
Closed

The video readStream can not be played over the network #2643

wangaiyong opened this issue Apr 18, 2022 · 1 comment
Labels
stale Closed due to inactivity or lack or resources

Comments

@wangaiyong
Copy link

wangaiyong commented Apr 18, 2022

Bug

The video readStream can not be played over the network. however , the video readStream can be played by using WebView.
Thank you for creating this component!

Platform

  • Android ExoPlayer
    "react-native-video": "^5.2.0",

Environment info

info Fetching system and libraries information...
System:
OS: Windows 10 10.0.19042
CPU: (8) x64 AMD Ryzen 5 1400 Quad-Core Processor
Memory: 3.72 GB / 15.95 GB
Binaries:
Node: 16.14.2 - ~\AppData\Local\Temp\yarn--1650247756858-0.830528188353884\node.CMD
Yarn: 1.22.17 - ~\AppData\Local\Temp\yarn--1650247756858-0.830528188353884\yarn.CMD
npm: 8.5.0 - D:\ENGLISH\nodejs_current\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: Not Found
Visual Studio: Not Found
Languages:
Java: 11.0.14.1
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.68.1 => 0.68.1
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found
Done in 4.52s.

Steps To Reproduce

#1 my source :
++++++++++++++++++++++++
<Video
onEnd={onEnd}
onLoad={onLoad}
onLoadStart={onLoadStart}
onProgress={onProgress}
paused={paused}
ref={videoPlayer}
resizeMode={screenType}
onFullScreen={isFullScreen}
source={{
uri:
'https://tyo.im/1114.mp4',
// 'http://127.0.0.1:2000',
}}
style={styles.mediaPlayer}
volume={10}
/>
++++++++++++++++++++++++

#2 [http://localhost:2000 ] is creaded by nodejs(http.createServer) :
++++++++++++++++++++++++
http.createServer(function (request, response) {
response.writeHead(200, {
'Content-Type': 'video/mp4',
'Content-Length': file.length,
'Accept-Ranges': 'bytes',
'Keep-Alive': 'timeout=5, max=100',
'Connection': 'Keep-Alive'
});
var readStream = file.createReadStream();
pipeline(readStream, response, () => {});
}).listen(2000);
++++++++++++++++++++++++

#3 [https://tyo.im/1114.mp4 ] can be played :
image
image

#4 [http://localhost:2000 ] can not be played, when open the app , the app closes automatically:
image
image

Complement

[https://tyo.im/1114.mp4 ] ,[http://localhost:2000 ] also can be played with WebView

#1 my source :
++++++++++++++++++++++++
<Button title="webview 127.0.0.1:2000"
onPress={() => {
setHtml(< video controls="" autoplay="" name="media"><source src= http : //127.0.0.1:2000 type="video/mp4">< / video

);
}} />

<Button title="webview https://tyo.im/1114.mp4"
onPress={() => {
setHtml(< video controls="" autoplay="" name="media"><source src= http s : //tyo.im/1114.mp4 type="video/mp4">< / video >);
}} />

<WebView source={{html: html}}/>
++++++++++++++++++++++++

#2 [https://tyo.im/1114.mp4 ] can be played with WebView :
image

#3 [http://127.0.0.1::2000 ] can be played with WebView :
image

@freeboub
Copy link
Collaborator

Thank you for the report.
on which platform do you have the issue (ios, andorid, ... ) ?
Not sure on how we can help.. I tested sample url : https://tyo.im/1114.mp4 on master branch. I can play it (on android emulator).
So I think the issue is link to your "proxy server".
When you it crashes, can you provide a logcat of the crash please ? (if it is android for sure)

@hueniverse hueniverse added the stale Closed due to inactivity or lack or resources label Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Closed due to inactivity or lack or resources
Projects
None yet
Development

No branches or pull requests

3 participants