Reputation: 377
can you help me how can I stream my video to iOS app. I used UIWebView but video isnt chaning. Is there any solution. For example this stream. http://80.32.204.149:8080/mjpg/video.mjpg
Thank you for replies
Upvotes: 2
Views: 4228
Reputation: 22751
The simplest way to do MJPG streaming on iOS is by using UIImageView
and NSURLConnection
. Use NSURLConnection
to build the connection to your target URL and implement the delegate following methods:
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
--> fill up a buffer with the data that you receive here (the buffer should be of type NSData
and can be either an instance variable or a property)
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
and convert the data from your buffer there into a UIImage
using [UIImage imageWithData:buffer]
. This UIImage
can then be set on your UIImageView
.
Upvotes: 4