Skip to content

Can't play the video that load from the cached filePath #204

Closed
@wata

Description

@wata

I would like to cache AVURLAsset.

However, in order to play cached AVURLAsset, file extensions (mp4, etc ...) are necessary... The current filePath is ".../XXX", but in order to actually play it needs to be ".../XXX.mp4"...

static func video(forKey key: String) -> AVURLAsset? {
    do {
        let entry = try storage.transformData().entry(forKey: key)
        guard let filePath = EntryMeta(entry.meta)?.filePath else {
            return nil
        }
        return AVURLAsset(url: URL(fileURLWithPath: filePath)) // <= Can't play this AVURLAsset
    } catch let error {
        log.error(error)
        return nil
    }
}

Are there any good ideas?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions