Skip to content

Instantly share code, notes, and snippets.

@jebai0521
Created June 13, 2015 04:33
Show Gist options
  • Select an option

  • Save jebai0521/47d1073cfe4d20ea352e to your computer and use it in GitHub Desktop.

Select an option

Save jebai0521/47d1073cfe4d20ea352e to your computer and use it in GitHub Desktop.
因为播放器只支持播放NSURL参数的资源,所以要播放本地文件时,需要将路径参数转化为
本地路径构造URL,使用NSURL 提供的静态方法fileURLWithPath
Creating an NSURL
– initWithScheme:host:path:
+ URLWithString:
– initWithString:
+ URLWithString:relativeToURL:
– initWithString:relativeToURL:
+ fileURLWithPath:isDirectory:
– initFileURLWithPath:isDirectory:
+ fileURLWithPath:
– initFileURLWithPath:
+ fileURLWithPathComponents:
+ URLByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:
– initByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment