Skip to content

play from folder #2

@duca14036

Description

@duca14036

If files are located in subfolder thant it will not play even if to indicate file with path
Sound.swfit
should be changed to this function

public init(fileName: String, bundle: Bundle = Bundle.main) {
    super.init()
    
    let urlName = URL(fileURLWithPath: fileName)
    let file = urlName.deletingPathExtension().path
    let fileExtension = urlName.pathExtension
    
    name = fileName
    if let path =  bundle.path(forResource: file, ofType: fileExtension) {
        url = URL(fileURLWithPath: path)
        identifier = url?.absoluteString ?? ""
    }
    
    preparePlayer()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions