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

Can you add the ability to disable video caching? #95

Open
waterdrake opened this issue May 28, 2024 · 3 comments
Open

Can you add the ability to disable video caching? #95

waterdrake opened this issue May 28, 2024 · 3 comments

Comments

@waterdrake
Copy link

Would it be possible to add an option to disable video caching all together?

The caching is very useful but in some instances disabling it is useful too. Otherwise, you have to call VideoCacheManager.cleanAllCache() often.

@wxxsw
Copy link
Owner

wxxsw commented May 29, 2024

There is no suitable method yet, but generating a normal AVPlayerItem at play(for url: URL) should close the cache. Sorry, I may not be able to support it, you can fork first, or submit a PR

@waterdrake
Copy link
Author

@wxxsw Can you give an example of what you mean by generating a normal AVPlayerItem at play(for url: URL)?

@wxxsw
Copy link
Owner

wxxsw commented Jun 3, 2024

For example:

if cacheDisabled {
    playerItem = AVPlayerItem(url: url)
} else {
    playerItem = AVPlayerItem(loader: url)
    playerItem.canUseNetworkResourcesForLiveStreamingWhilePaused = true
}

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

2 participants