Note that there are some explanatory texts on larger screens.

plurals
  1. POiPHONE I get a white screen when I try to play a video I loaded and stored in Documents directory
    primarykey
    data
    text
    <p>I did see some answers for this question, but they did not work.</p> <p>I am loading a video from a web server, saving it in the documents directory and then trying to play it. My first version saved it in the home directory and it worked fine. When I change the code to save it in the documents directory, the video no longer played,</p> <p>I tried using the following code to get the home directory, as posted when this same question was asked.</p> <pre><code>NSString *userDocumentsPath = nil; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); if ([paths count] &gt; 0) { userDocumentsPath = [paths objectAtIndex:0]; } </code></pre> <p>The code to save the video</p> <pre><code>///////////////////////////////////////////////////////////////////////////////// // Save vedio NSFileManager *mFile= [NSFileManager defaultManager]; NSString *userDocumentsPath = nil; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); if ([paths count] &gt; 0) { userDocumentsPath = [paths objectAtIndex:0]; } NSString *filename=[userDocumentsPath stringByAppendingPathComponent:@"ted.mp4"]; b=[mFile createFileAtPath:filename contents: receivedData attributes:nil]; if ( [mFile fileExistsAtPath:filename]==true ) i++; </code></pre> <p>the code to play the video </p> <pre><code>NSString *userDocumentsPath = nil; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); if ([paths count] &gt; 0) { userDocumentsPath = [paths objectAtIndex:0]; } NSString *filename=[userDocumentsPath stringByAppendingPathComponent:@"ted.mp4"]; // play it NSURL *fileUrl=[ NSURL fileURLWithPath:filename];// mp=[[MPMoviePlayerController alloc] initWithContentURL: fileUrl]; </code></pre>
    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.
 

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