TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | Commercial |
ReleasedLast Release | Jan 2016 |
Maintained by Gabi Dobocan, Ovidiu D. Nitan.
Depends on: | |
KAProgressLabel | ~> 3.0 |
TBXML | ~> 1.5 |
TSMiniWebBrowser | >= 0 |
The Veeplay Media Player allows you to:
Install cocoapods, and then run
pod try Veeplay
There are currently two integration paths: via CocoaPods or via standard library download.
Installing via CocoaPods (recommended)
Add the following line to your podfile:
pod 'Veeplay'
Run pod install
to install the player and all the dependencies. Run pod update
to keep the library updated.
Installing via library download
Add MediaPlayer.framework
, AVFoundation.framework
, CoreMedia.framework
, SystemConfiguration.framework
and libz.dylib
to your project.
MediaPlayer.framework
, AVFoundation.framework
and libz.dylib
to your project.Add the player’s static library to your project.
Add the player’s header files to your project.
Drag all the header files in the “headers” folder into your Xcode project OR
Select your target in the project settings screen.
Add the player’s resource files to your project.
Set up an account at http://panel.veeso.co and add your application's bundle identifier under "License Management".
Import the Player’s header file, as well as the VAST/VMAP or other plugins:
#import "APSMediaPlayer.h"
#import "APSVASTMediaBuilderPlugin.h"
Create a new APSMediaBuilder instance and add plugins as required APSMediaUnit :
APSMediaBuilder *builder = [[APSMediaBuilder alloc] init];
[builder addPlugin:[[APSVASTMediaBuilderPlugin alloc] init]];
Optionally, APSMediaUnit set the debugMode flag to YES to enable console logging:
builder.debugMode = YES;
Add the media player to a view:
[APSMediaPlayer sharedInstance].view.frame = CGRectMake(5, 5, 310, 450);
[self.view addSubview:[APSMediaPlayer sharedInstance].view];
The next step is to create a playlist of APSMediaUnit
s to feed to the player for playback. This is what the builder
object does; it acts like a configurable APSMediaUnit
and APSMediaOverlay
factory. Configuration can be done by specifying a URL to a JSON configuration file or by providing a similar configuration structure in a NSDictionary
container.
Since remote configuration is a process involving network requests, the builder exposes an asynchroneous configuration method:
[builder configureFromURL:[NSURL URLWithString:@"http://example.com/player.json"] onComplete:^ {
// TODO: Request and play media units here
}];
The builder is configured at this point and is able to generate an array of media units ready for playback. When requesting unit generation however, plugins like APSVASTMediaBuilderPlugin
require making additional network requests in order to work. So, again, there is an asynchroneous unit retrieval method:
[builder configureFromURL:[NSURL URLWithString:@"http://example.com/player.json"] onComplete:^ {
[builder requestMediaUnitsWithCompletionBlock:^(NSArray *units) {
[[APSMediaPlayer sharedInstance] playMediaUnits:units];
}];
}];
In the final execution block we instruct the player to start playback using the final generated array of media units, configured remotely via JSON input.
See this guide for documentation on all available configuration options and examples.
APSMediaPlayer allows developers to create their own, JSON or dictionary configurable overlays. To create a custom overlay:
UIViewController
subclass itself.self.overlay.parameters
. You can also access information about the currently running unit, using self.overlay.parentUnit
.APSMediaPlayerOverlayControllerProtocol
for a complete list.Register the newly created class with the player:
[[APSMediaPlayer sharedInstance] registerClass:[CLASSNAME class] inGroup:kAPSMediaPlayerOverlayControllersGroup type:@"TYPE"];
You can enable Chromecast playback by adding chromecast
into the components array under the controls
section in your JSON configuration file:
{
"content": [
"url": "http://......",
"autoplay": true,
"controls": {
"components": [
"playback",
"totalTime",
"slider",
"currentTime",
"chromecast"
]
}
]
}
Also you can configure this programatically by adding APSChromecastControl to the controlsParameters
property on APSMediaUnit
:
unit.controlsParameters = @{kAPSControlsComponents: @(APSPlaybackControl|APSCurrentTimeControl|APSTimeSliderControl|APSTotalTimeControl|APSChromecastControl|APSFullScreenControl)};
APSMediaPlayer provides support for Marlin DRM, using the SDKs provided by ExpressPlay. To install:
Add the following line to your Podfile:
pod "VeeplayMarlinManager"
If installing without CocoaPods, get the latest static library and header files from the repository.
Import the VeeplayMarlinManager header file:
#import "VeeplayMarlinManager.h"
Instantiate a Marlin manager object and register it with the player:
VeeplayMarlinManager *marlinManager = [[VeeplayMarlinManager alloc] init];
[[APSMediaPlayer sharedInstance] registerUnitManager:marlinManager];
Set the managerType
property of the APSMediaUnit
object to @"marlin"
.
kAPSMetadataDrmUrl
key in the metadata
dictionary of an item to the string URL to the license file. To configure from JSON, set the drm_encoding_url
metadata key.Configuring a unit progamatically:
APSMediaUnit *unit = [[APSMediaUnit alloc] init];
unit.url = [NSURL URLWithString:@"http://url.to/your-protected-media"];
unit.managerType = kVeeplayMarlinDRMEncoding;
unit.metadata = [NSMutableDictionary dictionaryWithDictionary: @{ kAPSMetadataDrmUrl: @"http://url.to/marlin-broadband-key" }];
Configuring a unit from JSON:
{
"url": "http://url.to/your-protected-media",
"manager": "marlin",
"metadata": {
"drm_encoding_url": "http://url.to/marlin-broadband-key"
}
}
See the full class reference here.
See a showcase project featuring code samples for various playback scenarios here.
If you have CocoaPods installed, you can instantly see a demo of the Veeplay player by typing pod try Veeplay
in your Terminal.
APSMediaPlayer relies on the following liberally-licensed pods installed as dependencies:
Appscend Video Solutions GmbH
Commercial license. Contact [email protected].