How to play movie files with no file extension on iOS with MPMoviePlayerController or AVPlayer?

后端 未结 8 1577
长发绾君心
长发绾君心 2020-12-05 13:58

I want to play a movie in iOS 4.3 on the iPad. I\'ve successfully used MPMoviePlayerController and AVPlayer to load files from a remote URL when the filename has a file exte

8条回答
  •  一整个雨季
    2020-12-05 14:14

    It's sort of a hack, but what you could do is run each name through a method that checks for a period with three characters after it. If not, just append .m4v automatically. Or get the MIME type and append an extension automatically based on the returned type. If available. Look up documentation with NSString for more info. Good luck! Let me know if that helped.

提交回复
热议问题