3

I'm new to iPhone development and have been trying to get a local video to play in the UIWebView. I load the UIWebView through the loadHTMLString method and the video url is file://...documents/uploads/../ax.mp4. The application crashes when I hit the play button of the video player in the webview. The video file is downloaded by the application from my http server, into the documents folder. If I give the path the file on the server, it plays properly.

This is the HTML snippet within the body tag, which I load in the 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 video tag, snippet of it is 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 the thread which crashed :

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 shown on the console (found it in the .crash file) is this:

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}

I searched for this error in the threads over last five months, but haven't found anything useful. Am I missing something here? can anybody help on this? Also, when it crashes I see that atleast 20 threads, majority from com.apple.coremedia, running? Is this because I'm doing it in the wrong way?

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Deepak
  • 71
  • 1
  • 2

0 Answers0