Skip to content

Commit

Permalink
Merge branch 'release/2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
defagos committed Jul 6, 2017
2 parents b690a83 + 865874c commit eb90289
Show file tree
Hide file tree
Showing 11 changed files with 129 additions and 109 deletions.
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "SRGSSR/SRGMediaPlayer-iOS" "2.0.2"
github "SRGSSR/srgdataprovider-ios" "5.2"
github "SRGSSR/srgdataprovider-ios" "5.3"
github "comScore/ComScore-iOS-SDK" "92f34897cd7659d56bb5a3e9e85b808cf3758bda"
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ github "Mantle/Mantle" "2.1.0"
github "SRGSSR/MAKVONotificationCenter" "4a127e52997889729286510103f7e27100223730"
github "SRGSSR/SRGMediaPlayer-iOS" "2.0.2"
github "SRGSSR/libextobjc" "cf5eb0c8a2f6f85636f1fb6a1f2083cbc74899f9"
github "SRGSSR/srgdataprovider-ios" "5.2"
github "SRGSSR/srgdataprovider-ios" "5.3"
github "SRGSSR/srglogger-ios" "1.0"
github "comScore/ComScore-iOS-SDK" "92f34897cd7659d56bb5a3e9e85b808cf3758bda"
github "kif-framework/KIF" "v3.5.2"
9 changes: 4 additions & 5 deletions Documentation/Getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ and implement the methods you need to supply measurement information:
// Mandatory
- (NSString *)srg_pageViewTitle
{
return @"home";
return @"home";
}

- (NSDictionary<NSString *, NSString *> *)srg_pageViewCustomLabels
{
return @{ @"myapp_category" : @"general" };
return @{ @"myapp_category" : @"general" };
}

@end
Expand Down Expand Up @@ -159,10 +159,9 @@ Our services directly supply the custom analytics labels which need to be sent t
This framework adds a category `SRGMediaPlayerController (SRGAnalytics_DataProvider)`, which adds playback methods for media compositions to `SRGMediaPlayerController`. To play a media composition retrieved from an `SRGDataProvider`, simply call:

```objective-c
SRGRequest *request = [mediaPlayerController playMediaComposition:mediaComposition withPreferredQuality:SRGQualityHD preferredStartBitRate:0 userInfo:nil completionHandler:^(NSError * _Nonnull error) {
// Deal with errors, or play the URL with a media player
SRGRequest *request = [mediaPlayerController playMediaComposition:mediaComposition withPreferredStreamingMethod:SRGStreamingMethodHLS quality:SRGQualityHD startBitRate:0 userInfo:nil resume:YES completionHandler:^(NSError * _Nonnull error) {
// Deal with errors, or play the URL with a media player
}];
[request resume];
```
on an `SRGMediaPlayerController` instance. Note that the play method returns an `SRGRequest` which must be resumed so that a token is retrieved before attempting to play the media.
Expand Down
2 changes: 1 addition & 1 deletion Framework_DataProvider/SRGAnalytics_DataProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@

// Public headers.
#import "SRGMediaPlayerController+SRGAnalytics_DataProvider.h"
#import "SRGSegment+SRGAnalytics_DataProvider.h"
#import "SRGSubdivision+SRGAnalytics_DataProvider.h"
Original file line number Diff line number Diff line change
Expand Up @@ -17,64 +17,67 @@ NS_ASSUME_NONNULL_BEGIN
@interface SRGMediaPlayerController (SRGAnalytics_DataProvider)

/**
* Return a request for preparing to play a media composition, trying to use the specified quality. The request can
* be started automatically if `resume` is set to `YES`. If set to `NO`, you are responsible of starting the request,
* either by calling `-resume` on it or adding it to a request queue.
* Return a request for preparing to play a media composition, trying to use the specified preferred settings. The request
* can be started automatically if `resume` is set to `YES`. If set to `NO`, you are responsible of starting the request,
* either by calling `-resume` on it or adding it to a request queue. If no exact match can be found for the specified
* settings, a recommended valid setup will be used instead.
*
* @param mediaComposition The media composition to prepare.
* @param preferredProtocol The protocol to use. If `SRGProtocolNone` or if the protocol is not found, a recommended
* protocol will be used instead.
* @param preferredQuality The quality to use. If `SRGQualityNone` or not found, the best available quality
* is used.
* @param preferredStartBitRate The bit rate the media should start playing with, in kbps. This parameter is a recommendation
* with no result guarantee, though it should in general be applied. The nearest available
* quality (larger or smaller than the requested size) will be used. Usual SRG SSR valid bit
* ranges vary from 100 to 3000 kbps. Use 0 to start with the lowest quality stream.
* @param userInfo Optional dictionary conveying arbitrary information during playback.
* @param resume Set to `YES` if you want the request to be started automatically.
* @param completionHandler The completion handler will be called once the player is prepared, or if a request
* error is encountered (it will not be called if the player cannot play the content;
* listen to `SRGMediaPlayerPlaybackDidFailNotification` to catch playback errors).
* @param mediaComposition The media composition to prepare.
* @param streamingMethod The streaming method to use. If `SRGStreamingMethodNone` or if the method is not
* found, a recommended method will be used instead.
* @param quality The quality to use. If `SRGQualityNone` or not found, the best available quality
* is used.
* @param startBitRate The bit rate the media should start playing with, in kbps. This parameter is a
* recommendation with no result guarantee, though it should in general be applied. The
* nearest available quality (larger or smaller than the requested size) will be used.
* Usual SRG SSR valid bit ranges vary from 100 to 3000 kbps. Use 0 to start with the
* lowest quality stream.
* @param userInfo Optional dictionary conveying arbitrary information during playback.
* @param resume Set to `YES` if you want the request to be started automatically.
* @param completionHandler The completion handler will be called once the player is prepared, or if a request
* error is encountered (it will not be called if the player cannot play the content;
* listen to `SRGMediaPlayerPlaybackDidFailNotification` to catch playback errors).
*
* @return The playback request. If successful, the player will be paused on the chapter / segment specified by
* the media composition. The method might return `nil` if no protocol / quality combination is found.
*/
- (nullable SRGRequest *)prepareToPlayMediaComposition:(SRGMediaComposition *)mediaComposition
withPreferredProtocol:(SRGProtocol)preferredProtocol
preferredQuality:(SRGQuality)preferredQuality
preferredStartBitRate:(NSInteger)preferredStartBitRate
withPreferredStreamingMethod:(SRGStreamingMethod)streamingMethod
quality:(SRGQuality)quality
startBitRate:(NSInteger)startBitRate
userInfo:(nullable NSDictionary *)userInfo
resume:(BOOL)resume
completionHandler:(nullable void (^)(NSError * _Nullable error))completionHandler;

/**
* Return a request for playing a media composition, trying to use the specified quality. The request can
* Return a request for playing a media composition, trying to use the specified preferred settings. The request can
* be started automatically if `resume` is set to `YES`. If set to `NO`, you are responsible of starting the request,
* either by calling `-resume` on it or adding it to a request queue.
* either by calling `-resume` on it or adding it to a request queue. If no exact match can be found for the specified
* settings, a recommended valid setup will be used instead.
*
* @param mediaComposition The media composition to play.
* @param preferredProtocol The protocol to use. If `SRGProtocolNone` or if the protocol is not found, a recommended
* protocol will be used instead.
* @param preferredQuality The quality to use. If `SRGQualityNone` or not found, the best available quality
* is used.
* @param preferredStartBitRate The bit rate the video should at least start with, in kbps. This parameter is a
* recommendation with no result guarantee, though it should in general be applied. The
* nearest available quality (larger or smaller than the requested size) will be used.
* Usual SRG SSR valid bit ranges vary from 100 to 3000 kbps. Use 0 to start with the
* lowest quality stream.
* @param userInfo Optional dictionary conveying arbitrary information during playback.
* @param resume Set to `YES` if you want the request to be started automatically.
* @param completionHandler The completion handler will be called once the player is playing, or if a request
* error is encountered (it will not be called if the player cannot play the content;
* listen to `SRGMediaPlayerPlaybackDidFailNotification` to catch playback errors).
* @param mediaComposition The media composition to play.
* @param streamingMethod The streaming method to use. If `SRGStreamingMethodNone` or if the method is not
* found, a recommended method will be used instead.
* @param quality The quality to use. If `SRGQualityNone` or not found, the best available quality
* is used.
* @param startBitRate The bit rate the media should start playing with, in kbps. This parameter is a
* recommendation with no result guarantee, though it should in general be applied. The
* nearest available quality (larger or smaller than the requested size) will be used.
* Usual SRG SSR valid bit ranges vary from 100 to 3000 kbps. Use 0 to start with the
* lowest quality stream.
* @param userInfo Optional dictionary conveying arbitrary information during playback.
* @param resume Set to `YES` if you want the request to be started automatically.
* @param completionHandler The completion handler will be called once the player is prepared, or if a request
* error is encountered (it will not be called if the player cannot play the content;
* listen to `SRGMediaPlayerPlaybackDidFailNotification` to catch playback errors).
*
* @return The playback request. If successful, the player will start on the chapter / segment specified by
* the media composition. The method might return `nil` if no protocol / quality combination is found.
*/
- (nullable SRGRequest *)playMediaComposition:(SRGMediaComposition *)mediaComposition
withPreferredProtocol:(SRGProtocol)preferredProtocol
preferredQuality:(SRGQuality)preferredQuality
preferredStartBitRate:(NSInteger)preferredStartBitRate
withPreferredStreamingMethod:(SRGStreamingMethod)streamingMethod
quality:(SRGQuality)quality
startBitRate:(NSInteger)startBitRate
userInfo:(nullable NSDictionary *)userInfo
resume:(BOOL)resume
completionHandler:(nullable void (^)(NSError * _Nullable error))completionHandler;
Expand Down
Loading

0 comments on commit eb90289

Please sign in to comment.