Video Player SDK for iOS and tvOS

Video Player SDK for iOS and tvOS

Released 2 years ago , Last update 7 months ago

A multifunction video player that supports most audio and video formats via SMB / CIF, FTP, SFTP, WebDAV and Cloud Services, with support for popular streaming protocols.

Apple's standard video player supports just a few video formats, only HTTP video streaming and has limited ability to control playback. In our SDK we resolved these problems and provided additional features such as simple gestures for playback control and changing volume. Video Player SDK supports most video and audio formats (m3u8, AVI, MKV, WMV, MPEG, FLAC, etc.), as well as popular streaming protocols (HTTP, HTTPS, TCP, UDP, HLS, RTSP, RTMP, RTP, MMS).

Video Player SDK supports Full HD video playback, playlists, as well as streaming of standard video and audio formats via Google Chromecast. In addition, the SDK plays unsupported iOS video formats via Apple TV. Furthermore, you can quickly monetize future your app are using built-in support for Google AdMob.

For an example of Video Player SDK in action, check out the Remote Media Manager app, which was developed with it: https://itunes.apple.com/app/remote-media-manager-access/id981869721?mt=8

Features

Environment

  •  Runs on any iOS device (all iPad models except 1st generation, iPhone 4, 4S, 5, 5S, 6 and 6+)
  • Supports tvOS only at base level without extended UI as for iOS.
  •  Supports all iOS rotation alignments and screen types.
  •  Supports armv7, armv7s, arm64, i386 and x86-64.
  •  Supports 3G and Wi-Fi.
  •  Supports ARC.
  •  Works with all popular video and audio codecs.
  •  Supports delegates for notifications of state and playback time changes.
  •  Supports external screen video output (via cable).

Playback

  •  Basic actions (play, pause, stop, resume, fast forward, fast backward).
  •  Advanced actions (seek position, play from position, streaming pause).
  •  Save and restore playback progress actions.
  •  Background playback mode (audio, video).
  •  Playback speed control, audio and video syncing.
  •  Audio resampling.
  •  Features looping and playback time for files.
  •  Seeking in files (local and remote).
  •  Video quality selection.
  •  Audio track selection.
  •  Subtitle selection, including internal and external (which comes as a separate file).
  •  New adjustment: brightness, new gestures for adjusting.

Interface

  •  Supports multiple players on same view.
  •  Fullscreen, mini-player mode and no UI mode.
  •  Configurable gestures for player actions.
  •  Current playback time information.

Stream-related

  •  Supports AirPlay and Chromecast.
  •  Supports video mirroring to Apple TV for formats not supported by iOS.
  •  Supports streaming with HTTP, FTP, MMS, WebDAV, SMB, RTMP, RTSP and other protocols.
  •  Supports streaming from storage services (Google Drive, Yandex Disk, Box).
  •  Plays mjpeg streaming format (from IP cameras etc.).

File-related

  •  Plays local files.
  •  Plays popular media formats not supported by Apple.
  •  Plays GIF animation (including transparency).
  •  Shows thumbnails for the files iOS recognizes as video.

Package

  • Player Binaries, Custom Input Interfaces source code, and support source code for binary license.
  • All other licenses includes the full source code of the player.
  • Technical API documentation.
  • Detailed documentation with integration instructions.
  • Automated scripts for build libraries: ffmpeg, openssl, samba. Generates universal static libraries ( armv7, armv7s, i386 & arm64 architectures)

Download the FREE Trial and see how simple it is to add video streaming functionality to your app.

 Latest 3rd party libs Oct 22: download

 

 If you have any questions, please write to us by email . We will be glad to answer you.

Pricing

14 day 14-day money-back guarantee

$299.00

Application License

  • Perpetual license

  • 1 application

  • Can distribute binary products only

  • Commercial use

  • 3 months support

$1,099.00

Application License

  • Perpetual license

  • 5 applications

  • Can distribute binary products only

  • Commercial use

  • 3 months support

$1,999.00

Developer License

  • Perpetual license

  • Unlimited projects

  • Can distribute code and binary products

  • Commercial use

  • 6 months support

Need custom services for this product? Get a quote
  • We use this product to playback smb video files. It works excellently. The UI and UX of the player is commendable. We are excited to leverage its potential in our app in the future. Ultimate thing would be to come up with the same player on android. We look forward for it.

    DN David Nielsen
  • High performance video SDK, seeking and video playback in general is extremely smooth. Documentation isn't very clear here and there but still the best video player SDK on the market.

    PG Peter Groetzinger
  • Library is easy to use. Plays great all the formats. So far it seem to be fairly stable (no crashes yet). The best of all is the support. Developers at Macsoftex react instantly on all my requests (usually within a few minutes!). They even added support for AppleTV within a few days after I've ask for this option!!! Highly recommended.

    JV Josef Vosyka

Video Player Documentation

MADPlayer is an audio/video playback and streaming library for iOS. MADPlayer uses both AV Foundation Framework and FFmpeg library, providing for them unified object-oriented APIs.

Features

  • Supports as many formats as FFmpeg library does
  • Built-in UI elements, that can be easily customized
  • Possibility to implement your own data sources, at that having built-in support for streaming from HTTP, SMB.

Installation

Instalation with binaries


1) Add MADPlayer folder to your project. It contains:

  •  MADPlayer.framework
  •  MMPlayer.framework
  •  MADPlayerBundle.bundle
  •  MADPlayerResources.xcasset

2) Add system frameworks and dynamic libs:
- AVFoundation
- Accelerate
- OpenAL
- OpenGLES
- libiconv
- libbz2
- libz
- libstdc++

3) Build ffmpeg. To do this you need to run "3rd_party/build_libs.sh" script. After compilation finished, there will be "dependencies" folder. Add it to project.
Check 'Headers Search paths' in your project's target 'Build settings' it must contain paths for this libs headers.

4) Set your license key in the app delegate:
[[MADLicenseManager sharedManager] setLicenseSerialKey:@"YOUR_KEY"];
5) Add script in Build phase ./MADPlayer/MADPlayer.framework/licenseChecker YOUR_SERIAL_KEY

Instalation with source code.

1) Add MADPlayer.xcodeproj to your project
2) Download dependencies download or use script to build it (Scripts/DependenciesScripts/build_libs.sh).
3) Place it in folder which contains MADPlayer.xcodeproj
4) Go to YOUR_TARGET -> Build Settings and write proper path for headers and libs for dependencies (Header Search Path, Library Search Path)
5) Go to YOUR_TARGET -> Build Phases, add target dependency (MADPlayerIOS or MADPlayerTVOS) and link lib with binary (Target dependencies, Link binary with libraries).

Optional:
You can use MMPlayer/IOContext or create your own for playing from different sources. Also you can use MADPlayer/Core/ExternalPlayback for Chromecast and AppleTV playback.

6) Add system frameworks and dynamic libs:

  •  AVFoundation
  •  MobileCoreServices
  •  OpenAL
  •  OpenGLES
  •  libiconv
  •  libbz2
  •  libz
  •  libstdc++

Using additions

1) Embedded ADs
Read 'Using embedded ADs' to know how to enable/disable this feature.
2) Streaming to Chromecast
Player support streaming to Chromecast, but if you need this feature you must manually add its files to project:

  •  MADChromecastDeviceManager.h
  •  MADChromecastDeviceManager.m
  •  MADChromecastConnection.h
  •  MADChromecastConnection.m
  •  MADChromecastChannel.h
  •  MADChromecastChannel.m
  •  MADProxyServer.h
  •  MADProxyServer.m
  •  MADLocalProxyServer.h
  •  MADLocalProxyServer.m
  •  MADRemoteProxyServer.h
  •  MADRemoteProxyServer.m
  •  MADCORSProxyServer.h
  •  MADCORSProxyServer.m

Read the Setup section at iOS App Development to know how to add Google Cast SDK. Besides that Chromecast feature depends from GCDWebServer. Use instructions from GCDWebServer readme file and don't forget to add CFNetwork.framework.

3) Custom inputs for remote and cloud services
Read README.md for MMPlayer module

Getting Started

 

How to play files

If you simply need to play a sound without displaying any UI, you can do it like this:

 @property(nonatomic) MADQueuePlayer *player;
// ...
self.player = [[MADQueuePlayer alloc] init];
NSMutableArray *items = [NSMutableArray array]; // will be filled with MADPlayerItem instances
// Player item can be constructed from local file path. This code will play all items from your application documents directory
NSString *documentsPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0];
NSArray *contents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:documentsPath error:NULL];
for (NSString *item in contents)
{
    NSString *path = [documentsPath stringByAppendingPathComponent:item];
    MADPlayerItem *localPlayerItem = [MADPlayerItem playerItemWithPath:path];
    [items addObject:localPlayerItem];
}
// Also this may be done using NSURL objects for both local and streamable items
MADPlayerItem *streamablePlayerItem = [MADPlayerItem playerItemWithURL:[NSURL URLWithString:@"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"]];
// You can mix all kind of playable items in the same playlist
[items addObject:streamablePlayerItem];
// Finally create playlist and supply it to player
[self.player playPlaylist:[MADPlaylist playlistWithItems:items]];

How to display video track

To render video frames player can provide suitable UIView subclass. You must add this view to superview where you need. This will require you to use player delegate object.
Let's modify previous example, to see how this may be done (assuming you are inside UIViewController subclass).

 @interface MADRootViewController () <MADPlayerObserver>
// ...
self.player = [[MADQueuePlayer alloc] init];
[[MADObservationCenter defaultCenter] addObserver:self forPlayer:self.player];
MADPlayerItem *playerItem = [MADPlayerItem playerItemWithURL:[NSURL URLWithString:@"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"]];
[self.player playItem:playerItem];
// ...
- (void)player:(MADQueuePlayer *)player didStartPlayingItem:(MADPlayerItem *)item
{
    dispatch_async(dispatch_get_main_queue(), ^{
        UIView *videoView = player.viewForVideoRendering;
        videoView.frame = CGRectMake(0, 0, 320, 320);
        [self.view addSubview:videoView];
    });
}

How to play files from remote sources

To play files from, for example, SMB you must create an implementation of MADDataSource protocol. For example this may look like this:

// .h
@interface MADSMBDataSource : NSObject <MADDataSource>
@property(nonatomic, readonly) NSString *path;
- (instancetype)initWithPath:(NSString *)path;
@end
// .m
#import "MMPSmbInput.h"
// Don't forget to define initializer
- (NSString *)identifier
{
    return self.path;
}
-(NSURL *)URL
{
   return nil;
}

- (id<MMPCustomInputProtocol>)input { return [[MMPSmbInput alloc] initWithSmbFilePath:self.path]; }

Then you can play SMB item by creating it this way:

- (void)playItemFromSMBWithPath:(NSString *)path
{
    MADSMBDataSource *dataSource = [[MADSMBDataSource alloc] initWithPath:path];
    MADDataSourceAsset *asset = [MADDataSourceAsset assetWithDataSource:dataSource];
    MADPlayerItem *playerItem = [MADPlayerItem playerItemWithAsset:asset];
    [self.player playItem:playerItem];
}

Note that you must write code necessary for authorization of net services for whose you make data streams.

Presenting player GUI

For presenting player GUI you use MADPlayerManager instead of MADQueuePlayer.
This may look like this (assuming you are inside UIViewController subclass):

  @property(nonatomic) MADPlayerManager *playerManager;
// ...
self.playerManager = [[MADPlayerManager alloc] init];
NSMutableArray *items = [NSMutableArray array]; // Fill this array the same way as we did it in first example
NSUInteger initialItemIndex = 0;
[self.playerManager playPlaylist:[MADPlaylist playlistWithItems:items]
withInitialItemIndex:initialItemIndex
inViewController:self];

Using embedded player

Player supports embedding in any view where you need to display media.

  @property(nonatomic) MADEmbeddedComponent *embeddedComponent;
// ...
- (void)playPlaylist:(MADPlaylist *)playlist withInitialItemIndex:(NSUInteger)initialItemIndex inView:(UIView *)view
{
MADQueuePlayer *player = [[MADQueuePlayer alloc] init];
self.embeddedComponent = [[MADEmbeddedComponent alloc] initWithPlayer:player];
[self.embeddedComponent embedInView:view];
[player playPlaylist:playlist withInitialItemIndex:initialItemIndex];
}

Using embedded ADs

1. Add Google AdMob SDK to your project from https://developers.google.com/mobile-ads-sdk/download or use pod 'Google-Mobile-Ads-SDK'.
2. Add to your project:

  • MADBannerHolder.h
  • MADBannerHolder.m
  • MADBannerHolder_FullscreenController.h
  • MADBannerHolder_FullscreenController.m

3. In your appDelegate in `-application: didFinishLaunchingWithOptions:` method

  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Your code

[MADBannerHolderHelper setADIdentifier:YOUR_ADS_IDENTIFIER];
[MADBannerHolderHelper setAdEnabled:YES];

return YES;
}

You can also set banner size for iPad or iPhone

  {
[MADBannerHolderHelper setIPadBannerSizeName:kMADAdSizeFullBanner];
[MADBannerHolderHelper setIPhoneBannerSizeName:kMADAdSizeBanner];
}

Available banner size constants:

  • `kMADAdSizeBanner` - typically ad size 320x50.
  • `kMADAdSizeLargeBanner` - typically ad size 320x100.
  • `kMADAdSizeFullBanner` - typically ad size 468x60.
  • `kMADAdSizeLeaderboard` - typically ad size 728x90.

To remove ad banner wich is currently on the screen post notification with name MADBannerDefaultRemoveNotification. Also you can define your own notification name:
`[MADBannerHolderHelper setRemoveAdNotification:@"yourRemoveNotification"];`

To disable ads simply set
`[MADBannerHolderHelper setAdEnabled:NO];`

Example:

  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Your code
if (isAdsNeeded)
{
[MADBannerHolderHelper setADIdentifier:YOUR_ADS_IDENTIFIER];
[MADBannerHolderHelper setAdEnabled:YES];
[MADBannerHolderHelper setIPadBannerSizeName:kMADAdSizeFullBanner];
[MADBannerHolderHelper setIPhoneBannerSizeName:kMADAdSizeBanner];
[MADBannerHolderHelper setRemoveAdNotification:@"myAdRemoveNotificationName"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(removeAds) name:@"myAdRemoveNotificationName" object:nil];
}

return YES;
}

- (void)removeAds
{
[MADBannerHolderHelper setAdEnabled:NO];
}

Customization

Initial point of all you customizations is a MADPlayerManager subclass. Preferred method for overload are following:

- (MADComponent<MADDisplaying> *)componentForPlayerMode:(NSInteger)playerMode;

You can subclass incomplete MADComponent, as well as, for example, MADFullscreenComponent, there you may need to just change set of controls on bottom menu panel or something else. For doing this there is protocol also called MADFullscreenComponent with these methods:

- (MADPanelContainer *)containerForTopPanel;
- (MADPanelContainer *)containerForBottomPanel;
- (MADPanelContainer *)containerForLeftPanel;
- (MADPanelContainer *)containerForRightPanel;

For example, if you want to remove repeat mode and shuffle button items from bottom panel, you have to overload this method like this:

- (MADPanelContainer *)containerForBottomPanel
{
   MADPanelContainer *panelContainer = [[MADPanelContainer alloc] initWithComponent:self];
   
   [panelContainer addCategory:self.categoryFactory.playPreviousCategory];
   [panelContainer addCategory:self.categoryFactory.playPauseCategory];
   [panelContainer addCategory:self.categoryFactory.playNextCategory];
   return panelContainer;
}

Requirements

iOS 7.0 SDK or above is needed to compile Video Player SDK for iOS. The following Apple frameworks are also required:

  • SystemConfiguration (used in Reachability framework by Apple)
  • AVFoundation (needed by AVAudioSession)
  • OpenGLES (using when rendering pictures to screen)
  • GoogleCast
  • MediaAccessibility
  • CoreText
  • OpenAL
  • MMPlayer
  • MADPlayer

The following frameworks are needed for connecting to streams, decoding audio and video packets, and similar functionality:

  • libz
  • libresolv
  • libiconv
  • libbz2
  • libstdc++
  • libavcodec
  • libavformat
  • libavutil
  • libswscale
  • libswresample
  • libavfilter
  • libsmbclient
  • libtdb
  • libssl
  • libtalloc
  • libtevent
  • libwbclient
  • libcrypto
  • libavdevice
4 licenses, starting from From » $299.00 View Licenses

Get A Quote

What do you need?
  • Custom development
  • Integration
  • Customization / Reskinning
  • Consultation
When do you need it?
  • Soon
  • Next week
  • Next month
  • Anytime

Thanks for getting in touch!

Your quote details have been received and we'll get back to you soon.

or Get a quote

for customization or integration services


Or enter your name and Email
  • PC Ping Chen 3 months ago
    Hi, We're a team interested in using your product as the viewing client of our streaming app. We need the low latency of RTMP for iOS viewers, so I'm just confirming that this supports RTMP viewing on iOS. Also, we require timed metadata extraction on the iOS viewer side for time-sensitive events. Does this support that functionality?
  • OY Onore Yelle 4 months ago
    Hi, Basically: -> I'm extracting the zip file. -> pod install (works properly) -> Open the MADPlayerFullWithDemo.xcworkspace -> Most of the frameworks files are in red (it seems that the target is still for iOS 9 SDK : Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/CFNetwork.framework) -> Compiling is resulting in a fail with the following error: 'No visible @interface for 'GCKDeviceScanner' declares the selector 'initWithFilterCriteria:'' Thanks, Olivier
  • OY Onore Yelle 4 months ago
    Hi, It seems that the install procedure doesn't work with Xcode 8. Pods are not installed properly :-( Thanks
    • EL Evgeny Lebedev Publisher 4 months ago
      Hi, What do you mean by the words "procedure does not work with Xcode 8". Can you provide us any error logs? What exactly is not working for you? Regards, Macsoftex team.