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

需要缓存完一整个视频才能播放 #24

Open
06110902002 opened this issue Apr 24, 2023 · 3 comments
Open

需要缓存完一整个视频才能播放 #24

06110902002 opened this issue Apr 24, 2023 · 3 comments

Comments

@06110902002
Copy link

假设文件大小有100mb ,需要将这100mb缓存完才能播放,缓存一部分时 为啥不能播放?求解

@JeffMony
Copy link
Owner

贴一个例子,我来看下

@06110902002
Copy link
Author

测试文件:
https://static-dev.nio.com/dc-operation/2022/11/16/g5sX1zY2BcfjORwH.mp4
http://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/gear1/prog_index.m3u8

复现步骤:
1.先看一遍上述文件,不需要看完,看10秒即可,这里能在本地路径看到缓存了一部分文件如图:
image
2.关闭网络退出,重启之后再播放,不停的打印日志:
SegFilePath=/storage/emulated/0/Android/data/com.jeffmony.sample/files/Video/jeffmony/7eb6d76ff95f6bbb0dc097666cea7d22/107.ts
2023-04-26 10:41:20.590 20597-27376/com.jeffmony.sample I/M3U8SegResponse: index=107, parentUrl=http://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/gear1/prog_index.m3u8, segUrl=http://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/gear1/fileSequence107.ts
2023-04-26 10:41:20.594 20597-32295/com.jeffmony.sample I/tv.danmaku.ijk.media.player.IjkMediaPlayer: onNativeInvoke 4
2023-04-26 10:41:20.595 20597-27376/com.jeffmony.sample I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2023-04-26 10:41:20.595 20597-27376/com.jeffmony.sample I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2023-04-26 10:41:20.596 20597-27376/com.jeffmony.sample W/System.err: com.jeffmony.videocache.common.VideoCacheException: send response failed:
2023-04-26 10:41:20.596 20597-27376/com.jeffmony.sample W/System.err: at com.jeffmony.videocache.socket.response.BaseResponse.sendResponse(BaseResponse.java:94)
2023-04-26 10:41:20.596 20597-27376/com.jeffmony.sample W/System.err: at com.jeffmony.videocache.socket.SocketProcessTask.run(SocketProcessTask.java:92)
2023-04-26 10:41:20.596 20597-27376/com.jeffmony.sample W/System.err: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at java.lang.Thread.run(Thread.java:923)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: Caused by: java.net.UnknownHostException: Unable to resolve host "devimages.apple.com.edgekey.net": No address associated with hostname
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:124)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at java.net.InetAddress.getAllByName(InetAddress.java:1152)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at com.android.okhttp.Dns$1.lookup(Dns.java:41)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:178)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at com.android.okhttp.internal.http.RouteSelector.nextProxy(RouteSelector.java:144)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:86)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:192)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:144)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:106)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:400)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:333)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at com.jeffmony.videocache.utils.HttpUtils.makeConnection(HttpUtils.java:95)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at com.jeffmony.videocache.utils.HttpUtils.getConnection(HttpUtils.java:44)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at com.jeffmony.videocache.utils.HttpUtils.getConnection(HttpUtils.java:36)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at com.jeffmony.videocache.socket.response.M3U8SegResponse.downloadSegFile(M3U8SegResponse.java:137)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at com.jeffmony.videocache.socket.response.M3U8SegResponse.sendBody(M3U8SegResponse.java:96)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at com.jeffmony.videocache.socket.response.BaseResponse.sendBodyWithCorrectTransferAndEncoding(BaseResponse.java:104)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: at com.jeffmony.videocache.socket.response.BaseResponse.sendResponse(BaseResponse.java:91)
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/System.err: ... 6 more
2023-04-26 10:41:20.597 20597-27376/com.jeffmony.sample W/SocketProcessTask: socket request failed, exception=com.jeffmony.videocache.common.VideoCacheException: send response failed:
2023-04-26 10:41:20.598 20597-32295/com.jeffmony.sample I/IJKMEDIA: Opening 'http://127.0.0.1:38331/aHR0cDovL2RldmltYWdlcy5hcHBsZS5jb20uZWRnZWtleS5uZXQvc3RyZWFtaW5nL2V4YW1wbGVzL2JpcGJvcF80eDMvZ2VhcjEvcHJvZ19pbmRleC5tM3U4JmplZmZtb255X3NlZyZodHRwOi8vZGV2aW1hZ2VzLmFwcGxlLmNvbS5lZGdla2V5Lm5ldC9zdHJlYW1pbmcvZXhhbXBsZXMvYmlwYm9wXzR4My9nZWFyMS9maWxlU2VxdWVuY2UxMDgudHMmamVmZm1vbnlfc2VnJi83ZWI2ZDc2ZmY5NWY2YmJiMGRjMDk3NjY2Y2VhN2QyMi8xMDgudHMmamVmZm1vbnlfc2VnJnVua25vd24' for reading
2023-04-26 10:41:20.598 20597-32295/com.jeffmony.sample I/tv.danmaku.ijk.media.player.IjkMediaPlayer: onNativeInvoke 1
2023-04-26 10:41:20.599 20597-32295/com.jeffmony.sample I/tv.danmaku.ijk.media.player.IjkMediaPlayer: onNativeInvoke 131073
2023-04-26 10:41:20.600 20597-32295/com.jeffmony.sample I/tv.danmaku.ijk.media.player.IjkMediaPlayer: onNativeInvoke 131074

@tjt852
Copy link

tjt852 commented Jan 10, 2024

image
你这个视频不是faststart类型的,这个mp4就是不支持边下边播

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

3 participants