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

Special Issue: 无法播放的 URL #25

Open
libobjc opened this issue Dec 30, 2017 · 29 comments
Open

Special Issue: 无法播放的 URL #25

libobjc opened this issue Dec 30, 2017 · 29 comments

Comments

@libobjc
Copy link
Member

libobjc commented Dec 30, 2017

如遇无法播放的 URL,可贴在此处。

@libobjc
Copy link
Member Author

libobjc commented Dec 30, 2017

#16

@hqyangtze
Copy link

现在支持 m3u8 格式链接吗?

@mysekai7
Copy link

http://zthome.ztjystore.cn/ltvZFllpBePw8P-PESfuYRqChV2G
这个视频资源无法缓存

@libobjc
Copy link
Member Author

libobjc commented Feb 26, 2018

@hqyangtze 还不行

@libobjc
Copy link
Member Author

libobjc commented Feb 26, 2018

@onechao 我 4G 测试是可以的

@MonkeyHZT
Copy link

设置MaxCacheLength为(2048 * 1024 * 1024 - 1)也不行

@huakucha
Copy link

@hqyangtze m3u8好像不能做缓存吧!?

@ptlCoder
Copy link

所有格式都支持吗

@chaserr
Copy link

chaserr commented Jul 13, 2018

现在好像还不支持 m3u8 格式链接吧?@libobjc

@JiaLiangoooo
Copy link

@JC-Passerby
Copy link

JC-Passerby commented Dec 13, 2018

@libobjc
Copy link
Member Author

libobjc commented Dec 13, 2018

@JC-Passerby 提供的 URL 没权限播。请提供无需授权的 URL 或完整日志。

@libobjc libobjc closed this as completed Dec 13, 2018
@libobjc libobjc reopened this Dec 13, 2018
@libobjc
Copy link
Member Author

libobjc commented Dec 13, 2018

@JiaLiangoooo 返回数据与 Header 中 Range 期望不符

@JC-Passerby
Copy link

JC-Passerby commented Dec 13, 2018 via email

@libobjc
Copy link
Member Author

libobjc commented Dec 13, 2018

@JC-Passerby 了解下 HTTP 请求 Header 中的 Range 字段,让服务端做对应支持。

@ChangbaDevs ChangbaDevs deleted a comment from JC-Passerby Dec 13, 2018
@JC-Passerby
Copy link

JC-Passerby commented Dec 13, 2018 via email

@libobjc
Copy link
Member Author

libobjc commented Dec 13, 2018

@JC-Passerby 是,库的实现原理强依赖断点续传,服务端必须支持。

@JC-Passerby
Copy link

JC-Passerby commented Dec 13, 2018 via email

@YelCode
Copy link

YelCode commented Aug 23, 2019

RTMP 能支持缓存吗?

@libobjc libobjc pinned this issue Jan 7, 2024
@QiuYeHong90
Copy link

QiuYeHong90 commented Feb 29, 2024

视频无法播放 集成到swift 项目里面无法播放现在 也不知道啥原因
https://dev-cdn.aurapura.app/feed/20240228/ejv7ad62mvgs31d8vu5t2h61rq-17091054161588.mp4

@QiuYeHong90
Copy link

QiuYeHong90 commented Feb 29, 2024

设置MaxCacheLength为(2048 * 1024 * 1024 - 1) 为什么就解决了我的问题呢

@QiuYeHong90
Copy link

https://dev-cdn.aurapura.app/feed/20240118/c31ev8l42ad9p01sdpc3511ro6-17055653591751.mp4
无法播放
KTVHCErrorUserInfoKeyResponse=<NSHTTPURLResponse: 0x28337cde0> { URL: https://dev-cdn.aurapura.app/feed/20240118/c31ev8l42ad9p01sdpc3511ro6-17055653591751.mp4 } { Status Code: 206, Headers {
Age = (
65194
);
"Content-Length" = (
2
);
"Content-Type" = (
"multipart/form-data"
);
Date = (
"Thu, 29 Feb 2024 08:33:12 GMT"
);
Etag = (
""9fe2a87889726b464d69b8e7dedd5dbd""
);
"Last-Modified" = (
"Thu, 18 Jan 2024 08:09:20 GMT"
);
Server = (
AmazonS3
);
Vary = (
Origin
);
Via = (
"1.1 9632d1035d26081ca0b420f4e84321a8.cloudfront.net (CloudFront)"
);
"content-range" = (
"bytes 0-1/6550537"
);
"x-amz-cf-id" = (
"SGVefJPlJsrv6XxYVYFlB178CnMII_vicJTF0TN3PFu5l8BOJCAv0w=="
);
"x-amz-cf-pop" = (
"LAX50-C1"
);
"x-amz-server-side-encryption" = (
AES256
);
"x-cache" = (
"Hit from cloudfront"
);
} }}
downloadLength : 0
readedLength : 0

@QiuYeHong90
Copy link

感觉没有以前的老版本稳定, 现在总是播放不动,
https://github.com/QiuYeHong90/KTVHTTPCache

@QiuYeHong90
Copy link

https://dev-cdn.aurapura.app/feed/20240122/kd9sl4k7bi3cl4bjm1n54atkrb-17059080494703.mp4
这个无法播放 日志一样的, 206 服务器是支持断点下载的其他视频都是正常的, 但是有些视频就是报错, 类似这样的, 不用缓存是可以正常播放的

@841023856
Copy link

https://sohugloba.oss-cn-beijing.aliyuncs.com/2024/11/05/606805c63b2a4551a4d75f08a2e130ef_1080x1920.mp4
这个URL缓存后播放不了,不用缓存可以播放

@libobjc
Copy link
Member Author

libobjc commented Nov 18, 2024

https://dev-cdn.aurapura.app/feed/20240122/kd9sl4k7bi3cl4bjm1n54atkrb-17059080494703.mp4 这个无法播放 日志一样的, 206 服务器是支持断点下载的其他视频都是正常的, 但是有些视频就是报错, 类似这样的, 不用缓存是可以正常播放的

@QiuYeHong90 此 URL 的 Content-Type 为 multipart/form-data,不在默认 Acceptable Content Types 白名单中。需要做如下设置(二选一即可):

// 设置 Acceptable Content Types 内包含 multipart/form-data
[KTVHTTPCache downloadSetAcceptableContentTypes:acceptableContentTypes]

// 在 Unacceptable Content Type Disposer 中对 multipart/form-data 放行
[KTVHTTPCache downloadSetUnacceptableContentTypeDisposer:^BOOL(NSURL *URL, NSString *contentType) {
    if ([contentType isEqualToString:@"multipart/form-data"]) {
        return YES;
    }
    return NO;
}];

@libobjc
Copy link
Member Author

libobjc commented Nov 18, 2024

https://sohugloba.oss-cn-beijing.aliyuncs.com/2024/11/05/606805c63b2a4551a4d75f08a2e130ef_1080x1920.mp4 这个URL缓存后播放不了,不用缓存可以播放

@841023856 单个视频文件大小超过默认缓存上限 500MB。可通过下面方法提高缓存上限:

/**
 *  Set the maximum cache length.
 *  If the current cache length exceeds the maximum length, it will be deleted starting with the oldest cached data.
 *
 *  @param maxCacheLength : The maximum cache length.
 */
+ (void)cacheSetMaxCacheLength:(long long)maxCacheLength;

@841023856
Copy link

841023856 commented Nov 18, 2024 via email

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