Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Step 1: Download the file &amp; save</strong></p> <pre><code>NSError *err = nil; NSString *url = [[NSString stringWithFormat:@"http://www.example.com/playlist.m3u8"] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSString *the_file = [NSString stringWithContentsOfURL:[NSURL URLWithString:url] encoding:NSUTF8StringEncoding error:&amp;err]; if(err != nil) { // do some error handling, e.g. NSLog(@"Fail: %@", [err localizedDescription]); } else { // save the file ( see Step 2 ) } </code></pre> <p><strong>Step 2 : Save the file</strong> </p> <p>You can either save it as file, or save it as an object .</p> <pre><code>// save as file NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *docDirectory = [paths objectAtIndex:0]; NSString *fileName = [NSString stringWithFormat:@"%@/playlist.m3u8", docDirectory]; [the_file writeToFile:fileName atomically:NO encoding:NSASCIIStringEncoding error:nil]; // OR, save as object [[NSUserDefaults standardUserDefaults] setObject:the_file forKey:@"MY_M3U8"]; </code></pre> <p><strong>Step 3 : Read the file</strong></p> <pre><code>// read from file NSString *textPath = [docDirectory stringByAppendingPathComponent:@"playlist.m3u8"]; // the FILE is loaded // OR, read from object NSString *content = [[NSUserDefaults standardUserDefaults] stringForKey:@"MY_M3U8"]; // it will contain the CONTENT of file </code></pre> <p><strong>Step 4 : Play it in your player</strong></p> <p>You should have done it. No need for me to write, yes?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload