iOS video streaming and storing on device afterwards

前端 未结 5 832
情书的邮戳
情书的邮戳 2020-12-23 17:27

So far I know how to stream a video and how to download it and afterwards stream it, but here\'s the tricky bit: streaming it once, storing it on the device and in the futur

5条回答
  •  温柔的废话
    2020-12-23 17:55

    BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:somePath];
    

    and

    fileURLWithPath:isDirectory:

    Initializes and returns a newly created NSURL object as a file URL with a specified path.

    + (id)fileURLWithPath:(NSString *)path isDirectory:(BOOL)isDir
    

    Parameters

    path

    The path that the NSURL object will represent. path should be a valid system path. If path begins with a tilde, it must first be expanded with stringByExpandingTildeInPath. If path is a relative path, it is treated as being relative to the current working directory. Passing nil for this parameter produces an exception.

    isDir

    A Boolean value that specifies whether path is treated as a directory path when resolving against relative path components. Pass YES if the path indicates a directory, NO otherwise. Return Value An NSURL object initialized with path.

    Availability

    Available in iOS 2.0 and later.

    You can't stream it and save it at the same time, especially with large video files as the Apple doc sais that you must use a transport stream for HTTP Live Streaming.

提交回复
热议问题