Reputation: 2662
I need to play locally stored Videos in my iOS app.
The videos are located in the directory: App/Resources/Videos/
When I try to get the path with:
NSBundle.mainBundle().pathForResource("myFile", ofType: "mp4", inDirectory: "App/Resources/Videos/")
I get nil. Any advice?
Upvotes: 1
Views: 908
Reputation: 203
Swift 5.4
Bundle.main.path(forResource: VideoHelper.vName, ofType: VideoHelper.vExtension)
Upvotes: 0
Reputation: 2662
Problem solved: the error was I didn't add the Target-Membership for the Videos.
Upvotes: 2
Reputation: 564
You can go ahead and remove inDirectory from the function call. Just search for your file in your app main bundle.It shall do the job for you.
Upvotes: 0