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

java.net.SocketTimeoutException & HttpDataSrouce$InvaildResponseCodeException : 503 #1743

Open
1 task
WoKee opened this issue Sep 20, 2024 · 3 comments
Open
1 task
Assignees
Labels

Comments

@WoKee
Copy link

WoKee commented Sep 20, 2024

Version

Media3 main branch

More version details

1.4.1

Devices that reproduce the issue

all device

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

No

Reproduction steps

1、Media url : ftp://a.gbl.114s.com:20320/8895/雪迷宫02.mp4

2、Using P2P libraries, convert to : http://127.0.0.1:8089/%D1%A9%C3%D4%B9%AC02.mp4

`
p2p.P2Pdoxstart(path.getBytes("GBK"));

   clock.setCallback(this);

   clock.stop().start();

   return "http://127.0.0.1:" + p2p.port + "/" + URLEncoder.encode(Uri.parse(path).getLastPathSegment(), "GBK");

`

3、Using IjkPlayer SDK / VLC SDK / Mpv SDK , can play successfully , but only using exoplayer play error.

4、The ExoPlayer HttpDataSource.Factory I am using.

`
private HttpDataSource.Factory getHttpDataSourceFactory() {

    if (httpDataSourceFactory == null)

        httpDataSourceFactory =  new OkHttpDataSource.Factory(new OkHttpClient.Builder().build());

    return httpDataSourceFactory;

}

`

Using OkHttpDataSource throw java.net.SocketTimeoutException :timeout.
Dingtalk_20240919173401

`
private HttpDataSource.Factory getHttpDataSourceFactory() {

    if (httpDataSourceFactory == null)

        httpDataSourceFactory =  new DefaultHttpDataSource.Factory();

    return httpDataSourceFactory;

}

`

Using DefaultHttpDataSource throw HttpDataSrouce$InvaildResponseCodeException : 503

Dingtalk_20240919175142

Expected result

play successfully

Actual result

error

Media

ftp://a.gbl.114s.com:20320/8895/雪迷宫02.mp4

Bug Report

  • You will email the zip file produced by adb bugreport to [email protected] after filing this issue.
@icbaker
Copy link
Collaborator

icbaker commented Sep 23, 2024

Converting an ftp:// URL to a localhost http:// URL sounds unusual - I suspect whatever is facilitating this 'conversion' (presumably by proxying HTTP calls and forwarding them over FTP) is responsible for the issues you're seeing.

Using DefaultHttpDataSource throw HttpDataSrouce$InvaildResponseCodeException : 503

This error is coming from the HTTP server - if you want to know why it's occuring, you need to inspect the server logs, we can't really help from the client side. In this case it seems likely the "HTTP server" is the tool you're using to "convert" from FTP to HTTP.

@WoKee
Copy link
Author

WoKee commented Sep 24, 2024

If it's an HTTP service issue, ijk or vlc will also fail to play.

http://127.0.0.1:8089/%D1%A9%C3%D4%B9%AC02.mp4

There is no problem with converting this address, and the IDM downloader can also download the file normally.

This is a P2P address, and I believe it is due to exo's DefaultMediaSourceFactory not correctly converting to the corresponding MediaSource (convert to ProgressiveMediaSource) , which caused the program to use the wrong BaseDataSource, OkHttpDataSource.open (DataSpec dataSpec)

This is just a speculation. If needed, I can provide a GitHub demo that integrates ijk and exo

@WoKee
Copy link
Author

WoKee commented Sep 24, 2024

log:

IJK : success

ijk.txt

EXO : fail

exo.txt

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

No branches or pull requests

2 participants