Playing a local video in UIWebView gives EXEC_BAD_ACCESS

I am new to iPhone development and trying to run local video in UIWebView. I am loading the UIWebView using the loadHTMLString method, and the video URL is //...documents/uploads/../ax.mp4. The application crashes when I click the play button of the video player in web browsing. The video file is downloaded by the application from my http server to the document folder. If I specify the path to the file on the server, it will play correctly.

This is the HTML snippet in the body tag that I upload to webview:

<div style=\"float:left;margin:5px 10px 5px 5px;\">
  <embed  qtsrc=\"%@\" type=\"application/x-shockwave-mp4\"  qtsrcdontusebrowser=\"true\" id=\"video\" src=\"%@\"  ></embed>
</div>

I also tried with the HTML5 tag, its snippet below:

<div style=\"float:left;margin:5px 10px 5px 5px;\">
  <video id =  \"video\" align=\"left\" src=\"%@\" controls=\"controls\">your  browser does not support the video tag</video>
</div>

The crash report has this for a crashed thread:

Thread 19 Crashed:  com.apple.coremedia.JVTlib
0   VideoToolbox                       0x02268a0e JVTLib_102630(unsigned  char*, unsigned char*, unsigned int, unsigned int, unsigned int,  unsigned int, unsigned int, unsigned char*, unsigned int) + 191
1   VideoToolbox                       0x020d3d4b  JVTLib_103304(JVTLib_101899*, unsigned int, unsigned int, unsigned int,  unsigned int) + 1101
2   VideoToolbox                       0x0206badd  JVTLib_100429(InstanceDecoStruct*, JVTLib_101484*, SeqParamSet*,  PicParamSet*, JVTLib_101481*, int, int, int*, unsigned int*, unsigned  int*, unsigned char, unsigned int, bool*, unsigned int*) + 5828
3   VideoToolbox                       0x02071d03 JVTLib_100973(int, JVTLib_101490*) + 718
4   VideoToolbox                       0x02072018 JVTLib_100979(void*) + 80
5   libSystem.B.dylib                  0x9493285d _pthread_start + 345
6   libSystem.B.dylib                  0x949326e2 thread_start + 34

and the message displayed on the console (found in the .crash file) is as follows:

13/05/11 7:13:57 PM     SpringBoard[1034]     Error deserializing wallpaper  image: Error Domain=CPBitmapErrorDomain Code=0 "The operation couldn’t  be completed. (CPBitmapErrorDomain error 0 - No data provided to  CPBitmapCreateImagesFromData)" UserInfo=0x70d16d0 {NSDescription=No data  provided to CPBitmapCreateImagesFromData}

, . - ? - ? , , , 20 , com.apple.coremedia, ? , ?

+3

All Articles