Skip to content

Commit

Permalink
Merge pull request #20 from muxinc/dj/extract-ima-listener
Browse files Browse the repository at this point in the history
Extract ima listener
  • Loading branch information
dylanjha authored Sep 17, 2019
2 parents 9b4ed8d + 9cc7ba9 commit ff62c56
Show file tree
Hide file tree
Showing 52 changed files with 638 additions and 391 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>0.1.5</string>
<string>1.0.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down
Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#ifndef MUXSDKPlayerBinding_h
#define MUXSDKPlayerBinding_h

#import <Foundation/Foundation.h>

@import AVKit;
@import AVFoundation;
#if TARGET_OS_IOS
@import MuxCore;
#else
@import MuxCoreTv;
#endif

typedef NS_ENUM(NSUInteger, MUXSDKPlayerState) {
MUXSDKPlayerStateReady,
MUXSDKPlayerStateViewInit,
MUXSDKPlayerStatePlay,
MUXSDKPlayerStateBuffering,
MUXSDKPlayerStatePlaying,
MUXSDKPlayerStatePaused,
MUXSDKPlayerStateError,
MUXSDKPlayerStateViewEnd,
};


@interface MUXSDKPlayerBinding : NSObject {
@private
NSString *_name;
NSString *_software;
AVPlayer *_player;
AVPlayerItem *_playerItem;
id _timeObserver;
MUXSDKPlayerState _state;
CGSize _videoSize;
CMTime _videoDuration;
BOOL _videoIsLive;
NSString *_videoURL;
CFAbsoluteTime _lastTimeUpdate;
NSTimer *_timeUpdateTimer;
CFAbsoluteTime _lastPlayheadTimeUpdated;
float _lastPlayheadTimeMs;
BOOL _seeking;
BOOL _started;
NSUInteger _lastMediaRequest;
NSUInteger _lastMediaRequestBytes;
NSUInteger _lastErrorLogEventCount;
NSUInteger _lastTransferEventCount;
double _lastTransferDuration;
long long _lastTransferredBytes;
}

- (id)initWithName:(NSString *)name andSoftware:(NSString *)software;
- (void)attachAVPlayer:(AVPlayer *)player;
- (void)detachAVPlayer;
- (CGRect)getViewBounds;
- (void)dispatchViewInit;
- (void)dispatchPlayerReady;
- (void)dispatchPlay;
- (void)dispatchPlaying;
- (void)dispatchPause;
- (void)dispatchTimeUpdateEvent:(CMTime)time;
- (void)dispatchError;
- (void)dispatchViewEnd;
- (void)dispatchAdEvent:(MUXSDKPlaybackEvent *)event;
- (float)getCurrentPlayheadTimeMs;
@end


@interface MUXSDKAVPlayerViewControllerBinding : MUXSDKPlayerBinding {
@private
AVPlayerViewController *_viewController;
}

- (id)initWithName:(NSString *)name software:(NSString *)software andView:(AVPlayerViewController *)view;

@end


@interface MUXSDKAVPlayerLayerBinding : MUXSDKPlayerBinding {
@private
AVPlayerLayer *_view;
}

- (id)initWithName:(NSString *)name software:(NSString *)software andView:(AVPlayerLayer *)view;

@end


#endif
18 changes: 5 additions & 13 deletions Frameworks/iOS/fat/MUXSDKStats.framework/Headers/MUXSDKStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
@import AVFoundation;
#if TARGET_OS_IOS
@import MuxCore;
#import "MUXSDKImaListener.h"
#else
@import MuxCoreTv;
#endif
#import "MUXSDKPlayerBinding.h"

FOUNDATION_EXPORT
@interface MUXSDKStats : NSObject
Expand All @@ -44,9 +44,10 @@ FOUNDATION_EXPORT
@param name A name for this instance of the player
@param playerData A MUXSDKCustomerPlayerData object with player metadata
@param videoData A MUXSDKCustomerVideoData object with video metadata
@return an instance of MUXSDKAVPlayerLayerBinding or null
@discussion Use this method to start a Mux player monitor on the given AVPlayerViewController. The player must have a name which is globally unique. The config provided should match the specifications in the Mux docs at https://docs.mux.com
*/
+ (void)monitorAVPlayerViewController:(nonnull AVPlayerViewController *)player withPlayerName:(nonnull NSString *)name playerData:(nonnull MUXSDKCustomerPlayerData *)playerData videoData:(nullable MUXSDKCustomerVideoData *)videoData;
+ (MUXSDKPlayerBinding *_Nullable)monitorAVPlayerViewController:(nonnull AVPlayerViewController *)player withPlayerName:(nonnull NSString *)name playerData:(nonnull MUXSDKCustomerPlayerData *)playerData videoData:(nullable MUXSDKCustomerVideoData *)videoData;

/*!
@method updateAVPlayerViewController:withPlayerName
Expand All @@ -64,9 +65,10 @@ FOUNDATION_EXPORT
@param name A name for this instance of the player
@param playerData A MUXSDKCustomerPlayerData object with player metadata
@param videoData A MUXSDKCustomerVideoData object with video metadata
@return an instance of MUXSDKAVPlayerLayerBinding or null
@discussion Use this method to start a Mux player monitor on the given AVPlayerLayer. The player must have a name which is globally unique. The config provided should match the specifications in the Mux docs at https://docs.mux.com
*/
+ (void)monitorAVPlayerLayer:(nonnull AVPlayerLayer *)player withPlayerName:(nonnull NSString *)name playerData:(nonnull MUXSDKCustomerPlayerData *)playerData videoData:(nullable MUXSDKCustomerVideoData *)videoData;
+ (MUXSDKPlayerBinding *_Nullable)monitorAVPlayerLayer:(nonnull AVPlayerLayer *)player withPlayerName:(nonnull NSString *)name playerData:(nonnull MUXSDKCustomerPlayerData *)playerData videoData:(nullable MUXSDKCustomerVideoData *)videoData;

/*!
@method updateAVPlayerLayer:withPlayerName:
Expand Down Expand Up @@ -104,14 +106,4 @@ FOUNDATION_EXPORT
*/
+ (void)programChangeForPlayer:(nonnull NSString *)name withVideoData:(nullable MUXSDKCustomerVideoData *)videoData;

/*!
@method getImaAdsListener:
@abstract Return an IMA Ads listener for Ad analytic collection
@param name The name of the player
@return an IMA event listener
@discussion Use this method to return an IMA Ads listener to collect IMA Ad event and Ad error event.
*/
#if TARGET_OS_IOS
+ (MUXSDKImaListener *)getImaAdsListener:(nonnull NSString *)name;
#endif
@end
Binary file modified Frameworks/iOS/fat/MUXSDKStats.framework/Info.plist
Binary file not shown.
Binary file modified Frameworks/iOS/fat/MUXSDKStats.framework/MUXSDKStats
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>0.1.5</string>
<string>1.0.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down
Binary file not shown.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#ifndef MUXSDKPlayerBinding_h
#define MUXSDKPlayerBinding_h

#import <Foundation/Foundation.h>

@import AVKit;
@import AVFoundation;
#if TARGET_OS_IOS
@import MuxCore;
#else
@import MuxCoreTv;
#endif

typedef NS_ENUM(NSUInteger, MUXSDKPlayerState) {
MUXSDKPlayerStateReady,
MUXSDKPlayerStateViewInit,
MUXSDKPlayerStatePlay,
MUXSDKPlayerStateBuffering,
MUXSDKPlayerStatePlaying,
MUXSDKPlayerStatePaused,
MUXSDKPlayerStateError,
MUXSDKPlayerStateViewEnd,
};


@interface MUXSDKPlayerBinding : NSObject {
@private
NSString *_name;
NSString *_software;
AVPlayer *_player;
AVPlayerItem *_playerItem;
id _timeObserver;
MUXSDKPlayerState _state;
CGSize _videoSize;
CMTime _videoDuration;
BOOL _videoIsLive;
NSString *_videoURL;
CFAbsoluteTime _lastTimeUpdate;
NSTimer *_timeUpdateTimer;
CFAbsoluteTime _lastPlayheadTimeUpdated;
float _lastPlayheadTimeMs;
BOOL _seeking;
BOOL _started;
NSUInteger _lastMediaRequest;
NSUInteger _lastMediaRequestBytes;
NSUInteger _lastErrorLogEventCount;
NSUInteger _lastTransferEventCount;
double _lastTransferDuration;
long long _lastTransferredBytes;
}

- (id)initWithName:(NSString *)name andSoftware:(NSString *)software;
- (void)attachAVPlayer:(AVPlayer *)player;
- (void)detachAVPlayer;
- (CGRect)getViewBounds;
- (void)dispatchViewInit;
- (void)dispatchPlayerReady;
- (void)dispatchPlay;
- (void)dispatchPlaying;
- (void)dispatchPause;
- (void)dispatchTimeUpdateEvent:(CMTime)time;
- (void)dispatchError;
- (void)dispatchViewEnd;
- (void)dispatchAdEvent:(MUXSDKPlaybackEvent *)event;
- (float)getCurrentPlayheadTimeMs;
@end


@interface MUXSDKAVPlayerViewControllerBinding : MUXSDKPlayerBinding {
@private
AVPlayerViewController *_viewController;
}

- (id)initWithName:(NSString *)name software:(NSString *)software andView:(AVPlayerViewController *)view;

@end


@interface MUXSDKAVPlayerLayerBinding : MUXSDKPlayerBinding {
@private
AVPlayerLayer *_view;
}

- (id)initWithName:(NSString *)name software:(NSString *)software andView:(AVPlayerLayer *)view;

@end


#endif
18 changes: 5 additions & 13 deletions Frameworks/iOS/release/MUXSDKStats.framework/Headers/MUXSDKStats.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
@import AVFoundation;
#if TARGET_OS_IOS
@import MuxCore;
#import "MUXSDKImaListener.h"
#else
@import MuxCoreTv;
#endif
#import "MUXSDKPlayerBinding.h"

FOUNDATION_EXPORT
@interface MUXSDKStats : NSObject
Expand All @@ -44,9 +44,10 @@ FOUNDATION_EXPORT
@param name A name for this instance of the player
@param playerData A MUXSDKCustomerPlayerData object with player metadata
@param videoData A MUXSDKCustomerVideoData object with video metadata
@return an instance of MUXSDKAVPlayerLayerBinding or null
@discussion Use this method to start a Mux player monitor on the given AVPlayerViewController. The player must have a name which is globally unique. The config provided should match the specifications in the Mux docs at https://docs.mux.com
*/
+ (void)monitorAVPlayerViewController:(nonnull AVPlayerViewController *)player withPlayerName:(nonnull NSString *)name playerData:(nonnull MUXSDKCustomerPlayerData *)playerData videoData:(nullable MUXSDKCustomerVideoData *)videoData;
+ (MUXSDKPlayerBinding *_Nullable)monitorAVPlayerViewController:(nonnull AVPlayerViewController *)player withPlayerName:(nonnull NSString *)name playerData:(nonnull MUXSDKCustomerPlayerData *)playerData videoData:(nullable MUXSDKCustomerVideoData *)videoData;

/*!
@method updateAVPlayerViewController:withPlayerName
Expand All @@ -64,9 +65,10 @@ FOUNDATION_EXPORT
@param name A name for this instance of the player
@param playerData A MUXSDKCustomerPlayerData object with player metadata
@param videoData A MUXSDKCustomerVideoData object with video metadata
@return an instance of MUXSDKAVPlayerLayerBinding or null
@discussion Use this method to start a Mux player monitor on the given AVPlayerLayer. The player must have a name which is globally unique. The config provided should match the specifications in the Mux docs at https://docs.mux.com
*/
+ (void)monitorAVPlayerLayer:(nonnull AVPlayerLayer *)player withPlayerName:(nonnull NSString *)name playerData:(nonnull MUXSDKCustomerPlayerData *)playerData videoData:(nullable MUXSDKCustomerVideoData *)videoData;
+ (MUXSDKPlayerBinding *_Nullable)monitorAVPlayerLayer:(nonnull AVPlayerLayer *)player withPlayerName:(nonnull NSString *)name playerData:(nonnull MUXSDKCustomerPlayerData *)playerData videoData:(nullable MUXSDKCustomerVideoData *)videoData;

/*!
@method updateAVPlayerLayer:withPlayerName:
Expand Down Expand Up @@ -104,14 +106,4 @@ FOUNDATION_EXPORT
*/
+ (void)programChangeForPlayer:(nonnull NSString *)name withVideoData:(nullable MUXSDKCustomerVideoData *)videoData;

/*!
@method getImaAdsListener:
@abstract Return an IMA Ads listener for Ad analytic collection
@param name The name of the player
@return an IMA event listener
@discussion Use this method to return an IMA Ads listener to collect IMA Ad event and Ad error event.
*/
#if TARGET_OS_IOS
+ (MUXSDKImaListener *)getImaAdsListener:(nonnull NSString *)name;
#endif
@end
Binary file modified Frameworks/iOS/release/MUXSDKStats.framework/Info.plist
Binary file not shown.
Binary file modified Frameworks/iOS/release/MUXSDKStats.framework/MUXSDKStats
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>0.1.5</string>
<string>1.0.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down
Binary file not shown.

This file was deleted.

Loading

0 comments on commit ff62c56

Please sign in to comment.