Skip to content

FOGMJPEGImageView is a UIImageView subclass dedicated to displaying a MJPEG from a remote feed.

License

Notifications You must be signed in to change notification settings

antonino-u/FOGMJPEGImageView

 
 

Repository files navigation

FOGMJPEGImageView

FOGMJPEGImageView is a UIImageView subclass dedicated to displaying a MJPEG from a remote feed.

A typical use case for FOGMJPEGImageView would be displaying a live webcam feed.

Installation

Copy the contents of the FOGMJPEGImageView directory into your project:

  • FOGJPEGImageMarker.h
  • FOGJPEGImageMarker.m
  • FOGMJPEGDataReader.h
  • FOGMJPEGDataReader.m
  • FOGMJPEGImageView.h
  • FOGMJPEGImageView.m
  • FOGMJPEGImageViewDelegate.h

Usage

With an instantiated FOGMJPEGImageView simply call startWithURL: passing the URL of the MJPEG feed you wish to display

FOGMJPEGImageView *mjpegImageView;
...
[mjpegImageView startWithURL:[NSURL URLWithString:@"http://192.168.0.1/mjpg/video.mjpg?camera=1"]];

You may halt the MJPEG feed by calling stop.

[mjpegImageView stop];

If you want to get informed about certain event you can make your class conform to the FOGMJPEGImageViewDelegate

@interface MyClass () <FOGMJPEGImageViewDelegate>

Set your class as the delegate of the FOGMJPEGImageView

    mjpegImageView.delegate = self;

And implement some or all of the given delegate methods from the protocol

- (void)FOGMJPEGImageViewDidReceiveImage:(FOGMJPEGImageView *)mjpegImageView
{
    // Handle success.
}

- (void)FOGMJPEGImageView:(FOGMJPEGImageView *)mjpegImageView loadingImgaeDidFailWithError:(NSError *)error
{
    // Handle error.
}

Maintainers

FOGMJPEGImageView is mainted by Richard C McGuire (@vf0g)

License

FOGMJPEGImageView is available under the MIT license. See the LICENSE file for more info.

About

FOGMJPEGImageView is a UIImageView subclass dedicated to displaying a MJPEG from a remote feed.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 97.6%
  • Ruby 2.4%