Mux

The Mux Developer Hub

Welcome to the Mux developer hub. You'll find comprehensive guides and documentation to help you start working with Mux as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started

Integration Guide: AVPlayer

Mux Data is the best way to monitor video streaming performance.

Integration is easy - just initialize the Mux SDK, pass in some metadata, and you're up and running in minutes.

Getting Started

This documents integration instructions for Apple's AVPlayerViewController and AVPlayerLayer. This integration supports iOS version 8.0 or newer, and tvOS version 9.0 or newer.

The Mux integration with AVPlayer and AVPlayerLayer is built on top of Mux's core Objective-C SDK, and the full code can be seen here: https://github.com/muxinc/mux-stats-sdk-avplayer.

1. Install the Mux Stats SDK

Installing with CocoaPods (preferred)

To install with CocoaPods, modify your Podfile to use frameworks by including use_frameworks! and then add the following pods to your Podfile:

  • pod 'Mux-Stats-AVPlayer', '~>1.3.0'

This will use our current release of our core Objective-C Library, which is version 2.2.2, as well as our current release of our AVPlayer wrapper. There will be no breaking updates in major versions past 1.x, so you can safely run pod update.

2. Add the Mux Stats monitor

Add the correct import statements for your target platform.

@import MUXSDKStats;
@import MUXSDKStatsTv;

To monitor the performance of an AVPlayer, call either monitorAVPlayerViewController:withPlayerName:playerData:videoData: or monitorAVPlayerLayer:withPlayerName:playerData:videoData:, passing a pointer to your AVPlayer container (either the AVPlayerLayer or AVPlayerViewController) to the SDK. The playerName parameter passed can be any string identifier for this instance of your player. When calling destroyPlayer or videoChangeForPlayer:withVideoData: to change the video, the same player name used for the monitor call must be used.

let playName = "iOS AVPlayer"
let playerData = MUXSDKCustomerPlayerData(environmentKey: "YOUR_ENVIRONMENT_KEY");
// insert player metadata
let videoData = MUXSDKCustomerVideoData();
// insert video metadata
MUXSDKStats.monitorAVPlayerViewController(self, withPlayerName: playName, playerData: playerData!, videoData: videoData);
// Environment and player data that persists until the player is destroyed
MUXSDKCustomerPlayerData *playerData = [[MUXSDKCustomerPlayerData alloc] initWithEnvironmentKey:@"EXAMPLE_ENV_KEY"];
// ...insert player metadata

// Video metadata (cleared with videoChangeForPlayer:withVideoData:)
MUXSDKCustomerVideoData *videoData = [MUXSDKCustomerVideoData new];
// ...insert video metadata

AVPlayerLayer *player = [AVPlayerLayer new];
[MUXSDKStats monitorAVPlayerLayer:player withPlayerName:@"awesome" playerData:playerData videoData:videoData];

3. Test it

After you've integrated, start playing a video in the player you've integrated with. A few minutes after you stop watching, you'll see the results in your Mux account. We'll also email you when your first video view has been recorded.

You can also test that Mux is receiving data in the Mux Data dashboard. Login to the dashboard and find the environment that corresponds to your env_key and look for video views.

Note that it may take a few minutes for views to show up in the Mux Data dashboard.

4. Add Metadata

Detailed Documentation

In the Objective-C SDKs, options are provided via the MUXSDKCustomerPlayerData and MUXSDKCustomerVideoData objects.

All metadata details except for env_key are optional, however you'll be able to compare and see more interesting results as you include more details. This gives you more metrics and metadata about video streaming, and allows you to search and filter on important fields like the player version, CDN, and video title.

// Environment and player data that persists until the player is destroyed
let playerData = MUXSDKCustomerPlayerData(environmentKey:"YOUR_ENVIRONMENT_KEY")
playerData.viewerUserId = "1234"
playerData.experimentName = "player_test_A"
playerData.playerName = "My Main Player"
playerData.playerVersion = "1.0.0"

// Video metadata (cleared with videoChangeForPlayer:withVideoData:)
let videoData = MUXSDKCustomerVideoData()
videoData.videoId = "abcd123"
videoData.videoTitle = "My Great Video"
videoData.videoSeries = "Weekly Great Videos"
videoData.videoDuration = 120000 // in milliseconds
videoData.videoIsLive = false
videoData.videoCdn = "cdn"

let videoUrl = video["url"]!
let url = URL(string: videoUrl)
player = AVPlayer(url: url!)
MUXSDKStats.monitorAVPlayerViewController(self, withPlayerName: playName, playerData: playerData!, videoData: videoData)
player.play()
// Environment and player data that persists until the player is destroyed
MUXSDKCustomerPlayerData *playerData = [[MUXSDKCustomerPlayerData alloc] initWithEnvironmentKey:@"EXAMPLE_ENV_KEY"];
playerData.viewerUserId = @"1234";
playerData.experimentName = @"player_test_A";
playerData.playerName = @"My Main Player";
playerData.playerVersion = @"1.0.0";

// Video metadata (cleared with videoChangeForPlayer:withVideoData:)
MUXSDKCustomerVideoData *videoData = [MUXSDKCustomerVideoData new];
videoData.videoId = @"abcd123";
videoData.videoTitle = @"My Great Video";
videoData.videoSeries = @"Weekly Great Videos";
videoData.videoDuration = @(120000); // in milliseconds
videoData.videoIsLive = @NO;
videoData.videoCdn = @"cdn";

AVPlayerLayer *player = [AVPlayerLayer new];
[MUXSDKStats monitorAVPlayerLayer:player withPlayerName:@"awesome" playerData:playerData videoData:videoData];

5. Set or Update Metadata After monitor (optional)

There are some cases where you may not have the full set of metadata until after the video playback has started. In this case, you should omit the values when you first call monitorAVPlayer*. Then, once you have the metadata, you can update the metadata with the updateCustomerDataForPlayer:withPlayerData:withVideoData: method.

// Sometime later before the player is destroyed you can do this:
// The player name ("awesome" in this example) should be a player that
// you have already called one of the `monitorAvPlayer` methods with
let videoData = MUXSDKCustomerVideoData()
videoData.videoTitle = "Video title"
videoData.videoId = @"bigbuckbunny"

// In this example we are updating videoData, but the same can be done
// for updating playerData
MUXSDKStats.updateCustomerData(forPlayer: "awesome", with: nil, with: videoData)
// Sometime later before the player is destroyed you can do this:
// The player name ("awesome" in this example) should be a player that
// you have already called one of the `monitorAvPlayer` methods with
MUXSDKCustomerVideoData *videoData = [MUXSDKCustomerVideoData new];
videoData.videoTitle = @"Big Buck Bunny";
videoData.videoId = @"bigbuckbunny";

// In this example we are updating videoData, but the same can be done
// for updating playerData
[MUXSDKStats updateCustomerDataForPlayer:@"awesome" withPlayerData:NULL withVideoData:videoData];

For more information, see the Metadata guide.

Changing the video

There are two cases where the underlying tracking of the video view need to be reset. First, when you load a new source URL into an existing player, and secondly when the program within a singular stream changes (such as a program within a live stream).

Note: You do not need to change the video info when changing to a different source of the same video content (e.g. different resolution or video format).

New Source

When you change to a new video (in the same player) you need to update the information that Mux knows about the current video. Examples of when this is needed are:

  • The player advances to the next video in a playlist
  • The user selects a different video to play

This is done by calling videoChangeForPlayer:withVideoData: which will remove all previous video data and reset all metrics for the video view. See Metadata for the list of video details you can provide. You can include any metadata when changing the video but you should only need to update the values that start with video_.

It is required to call videoChangeForPlayer immediately before telling the player which new source to play. This recommendation changed in v1.2.0.

It is also required to call player.play after replacing the current item.

If you have new player data you instead call videoChangeForPlayer:withPlayerData:withVideoData.

// Example of changing the AVPlayerItem

let videoData = MUXSDKCustomerVideoData()
videoData.videoId = "abcd123"
videoData.videoTitle = "My Great Video"
videoData.videoSeries = "Weekly Great Videos"
videoData.videoDuration = 120000 // in milliseconds
videoData.videoIsLive = false
videoData.videoCdn = "cdn"
MUXSDKStats.videoChange(forPlayer: "AVPlayer", with: videoData)

player.replaceCurrentItem(with: AVPlayerItem(url: url!))
player.play()
// Example of changing the AVPlayerItem
MUXSDKCustomerVideoData *videoData = [MUXSDKCustomerVideoData new];
videoData.videoId = @"abcd345";
videoData.videoTitle = @"My Other Great Video";
videoData.videoSeries = @"Weekly Great Videos";

[MUXSDKStats videoChangeForPlayer:@"awesome" withVideoData:videoData];
[player replaceCurrentItemWithPlayerItem:[AVPlayerItem playerItemWithURL:@"..."]];
[player play];

New Program (in single stream)

In some cases, you may have the program change within a stream, and you may want to track each program as a view on its own. An example of this is a live stream that streams multiple programs back to back, with no interruptions.

In this case, call programChangeForPlayer:withVideoData:. This will remove all previous video data and reset all metrics for the video view, creating a new video view. See Metadata for the list of video details you can provide. You can include any metadata when changing the video but you should only need to update the values that start with video.

Usage with Google Interactive Media Ads (IMA)

If you are using Google Interactive Media Ads, and specifically either the iOS sdk GoogleAds-IMA-iOS-SDK or the TvOS SDK GoogleAds-IMA-tvOS-SDK then we have another library that integrates for tracking ad playback events.

You should have a fully functioning GoogleAds-IMA integration working in your iOS or TvOS application before adding the Mux tracking. To add Mux ad tracking follow these steps:

  1. Add the pod 'Mux-Stats-Google-IMA' ~> '0.5.0' to your Podfile and run pod install
  2. import Mux_Stats_Google_IMA
  3. After initializing the Mux monitor with monitorAVPlayerViewController or monitorAVPlayerLayer, save this value to a variable (below it's called playerBinding)
  4. Create an imaListener instance by calling MuxImaListener.init(playerBinding: playerBinding!).
  5. Dispatch events to the imaListener in your adsLoader and adsManager delegate methods.
import MUXSDKStats
import MuxCore
import MUXSDKStats
import GoogleInteractiveMediaAds
import Mux_Stats_Google_IMA

override func viewDidLoad() {
    //
  // Follow the instructions from pod 'GoogleAds-IMA-iOS-SDK' to set up
  // your adsLoader and set your ViewController as the delegate
  //
  // From your ViewController, when you call either
  //    monitorAVPlayerViewController
  //    monitorAVPlayerLayer
  //
  // You will get back a MUXSDKPlayerBinding object
  //
  adsLoader.delegate = self
  let playerBinding = MUXSDKStats.monitorAVPlayerViewController(self, withPlayerName: playName, playerData: cpd!, videoData: cvd)

  //
  // Use the MUXSDKPlayerBinding object to initialize the MuxImaListener class
  //
    imaListener = MuxImaListener.init(playerBinding: playerBinding!)
}

// the adsLoader delegate will fire this and give access to the adsManager
// the application needs to register as a delegate for the adsManager too
func adsLoader(_ loader: IMAAdsLoader!, adsLoadedWith adsLoadedData: IMAAdsLoadedData!) {
    adsManager = adsLoadedData.adsManager;
    adsManager.delegate = self;
}

// all of these events get fired by the adsManager delegate
// when this happens, the application needs to do some stuff and send the events
// to our sdk
func adsManager(_ adsManager: IMAAdsManager!, didReceive event: IMAAdEvent!) {
    if (event.type == kIMAAdEvent_LOADED) {
      adsManager.start()
    }
    imaListener.dispatchEvent(event)
}

func adsManager(_ adsManager: IMAAdsManager!, didReceive error: IMAAdError!)
    avPlayer.play()
    imaListener.dispatchError(error.message)
}

func adsManagerDidRequestContentPause(_ adsManager: IMAAdsManager!) {
    avPlayer.pause()
    imaListener.onContentPauseOrResume(true)
}

func adsManagerDidRequestContentResume(_ adsManager: IMAAdsManager!) {
    avPlayer.play()
    imaListener.onContentPauseOrResume(false)
}
@import Mux_Stats_Google_IMA;

- (void)viewDidLoad {
  //
  // Follow the instructions from pod 'GoogleAds-IMA-iOS-SDK' to set up
  // your adsLoader and set your ViewController as the delegate
  //
  // From your ViewController, when you call either
  //    monitorAVPlayerViewController:withPlayerName:playerData:videoData:
  //    monitorAVPlayerLayer:withPlayerName:playerData:videoData:
  //
  // You will get back a MUXSDKPlayerBinding object
  //
  [MUXSDKPlayerBinding *playerBinding] = [MUXSDKStats monitorAVPlayerViewController:_avplayerController
                                  withPlayerName:DEMO_PLAYER_NAME
                                      playerData:playerData
                                       videoData:videoData];

  //
  // Use the MUXSDKPlayerBinding object to initialize the MuxImaListener class
  //
  _imaListener = [[MuxImaListener alloc] initWithPlayerBinding:playerBinding];
}

//
// when the adsLoader fires adsLoadedWithData you get a
// reference to the adsManager. Set your ViewController as the delegate
// for the adsManager
- (void)adsLoader:(IMAAdsLoader *)loader adsLoadedWithData:(IMAAdsLoadedData *)adsLoadedData {
    _adsManager = adsLoadedData.adsManager;
    _adsManager.delegate = self;
    IMAAdsRenderingSettings *adsRenderingSettings = [[IMAAdsRenderingSettings alloc] init];
    adsRenderingSettings.webOpenerPresentingController = self;
    [_adsManager initializeWithAdsRenderingSettings:adsRenderingSettings];
}

//
// Use these delegate methods to call dispatchEvent and send events
// through the imaListener
//
- (void)adsManager:(IMAAdsManager *)adsManager didReceiveAdEvent:(IMAAdEvent *)event {
    // When the SDK notified us that ads have been loaded, play them.
    if (event.type == kIMAAdEvent_LOADED) {
        [_adsManager start];
    }
    if (_imaListener != nil) {
        [_imaListener dispatchEvent:event];
    }
}

- (void)adsManager:(IMAAdsManager *)adsManager didReceiveAdError:(IMAAdError *)error {
    [_avplayer play];
    if (_imaListener != nil) {
        [_imaListener dispatchError: error.message];
    }
}

- (void)adsManagerDidRequestContentPause:(IMAAdsManager *)adsManager {
    [_avplayer pause];
    if (_imaListener != nil) {
        [_imaListener onContentPauseOrResume:true];
    }
}

- (void)adsManagerDidRequestContentResume:(IMAAdsManager *)adsManager {
    [_avplayer play];
    [_imaListener onContentPauseOrResume:false];
}

For complete example projects look in the "/apps" directory of mux-stats-sdk-avplayer on Github.

All of these apps have examples with Google IMA ads.

  • DemoApp is an iOS app written in objective-c
  • video-demo is an iOS app written in Swift
  • TVDemoApp is a TVOS app written in objective-c

Tracking orientation change

As of 1.3.0 Mux-Stats-AVPlayer can optionally track orientationchange events. To use this functionality, call MUXSDKStats orientationChangeForPlayer: withOrientation:.

These events will show up on the events log on the view views page.

class VideoPlayerController: AVPlayerViewController {
        override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
        MUXSDKStats.orientationChange(forPlayer: playName, with: self.viewOrientationForSize(size: size))
    }

    func viewOrientationForSize(size: CGSize) -> MUXSDKViewOrientation {
        return (size.width > size.height) ? MUXSDKViewOrientation.landscape : MUXSDKViewOrientation.portrait
    }
}
@implementation ViewController
  
  - (void)viewWillTransitionToSize:(CGSize)size
       withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
    [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {} completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
        [MUXSDKStats orientationChangeForPlayer:DEMO_PLAYER_NAME withOrientation:[self viewOrientationForSize:size]];

    }];
    }

  - (MUXSDKViewOrientation) viewOrientationForSize:(CGSize)size {
      return (size.width > size.height) ? MUXSDKViewOrientationLandscape : MUXSDKViewOrientationPortrait;
  }
 
@end

Usage with AVQueuePlayer

To use with AVQueuePlayer you will need to follow these steps:

  1. Listen for AVPlayerItemDidPlayToEndTime in your application
  2. When that notification fires, call videoChangeForPlayer:withVideoData

Here is an example that sets up a AVQueuePlayer with two items, and listener after the first item finishes playing and passes in new videoData.

let playName = "iOS AVPlayer"

override func viewDidLoad() {
    super.viewDidLoad()

    let item1 = AVPlayerItem(url: URL(string: "https://stream.mux.com/jY02nK1sxQKmJiQ7ltXY01w9LZQWdtNetE.m3u8")!)
    let item2 = AVPlayerItem(url: URL(string: "https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8")!)
    NotificationCenter.default.addObserver(
        self,
        selector: #selector(self.playerItemDidReachEnd),
        name: NSNotification.Name.AVPlayerItemDidPlayToEndTime,
        object: item1
    )
    player = AVQueuePlayer(items: [item1, item2])

    let playerData = MUXSDKCustomerPlayerData(environmentKey: "ENV_KEY");
    playerData?.playerName = "AVPlayer"
    let videoData = MUXSDKCustomerVideoData();
    videoData.videoIsLive = false;
    videoData.videoTitle = "Title1"
    MUXSDKStats.monitorAVPlayerViewController(self, withPlayerName: playName, playerData: playerData!, videoData: videoData);
    player!.play()
}

@objc func playerItemDidReachEnd (notification: NSNotification) {
    let videoData = MUXSDKCustomerVideoData();
    videoData.videoTitle = "Title2"
    videoData.videoId = "applekeynote2010-2"
    MUXSDKStats.videoChange(forPlayer: playName, with: videoData)
}

Handling Errors Manually

By default, automaticErrorTracking is enabled which means the Mux SDK will catch errors that the player throws and track an error event. Error tracking is meant for fatal errors. When an error is thrown it will mark the view as errored in the Mux dashboard and the view will no longer be monitored.

If you want to disable automatic and track errors manually you can do by passing in automaticErrorTracking: false to the monitor* method that you are using.

Weather automatic error tracking is enabled or disabled, you can dispatch errors manually with dispatchError.

let playName = "iOS AVPlayer"
let playerData = MUXSDKCustomerPlayerData(environmentKey: "YOUR_ENVIRONMENT_KEY");
// insert player metadata
let videoData = MUXSDKCustomerVideoData();
// insert video metadata
MUXSDKStats.monitorAVPlayerViewController(self,
                                          withPlayerName: playName,
                                          playerData: playerData!,
                                          videoData: videoData
                                          automaticErrorTracking: false);


//
// Later, you can dispatch an error yourself
//
MUXSDKStats.dispatchError("1234",
                          withMessage: "Something is not right",
                          forPlayer: playName)
NSString *playName = "iOS AVPlayer";

MUXSDKCustomerPlayerData *playerData = [[MUXSDKCustomerPlayerData alloc] initWithEnvironmentKey:@"YOUR_ENVIRONMENT_KEY"];
// ...insert player metadata
MUXSDKCustomerVideoData *videoData = [MUXSDKCustomerVideoData new];
// ...insert video metadata
AVPlayerLayer *player = [AVPlayerLayer new];
[MUXSDKStats monitorAVPlayerLayer:player
                   withPlayerName:playName
                       playerData:playerData
                        videoData:videoData
                     automaticErrorTracking: false];

//
// Later, you can dispatch an error yourself
//
[MUXSDKStats dispatchError:@"1234"
               withMessage:@"Something is not right"
                 forPlayer:playName]

Installing Manually With Carthage (not recommended)

The recommended way to install the Mux SDKs is with Cocoapods. However, if you want to install manually via Carthage that is supported.

If you are installing Mux-Stats-AVPlayer your Cartfile will also need to specify the mux-core objective-c library. Like this:

github "muxinc/mux-stats-sdk-avplayer" ~> 1.3.0
github "muxinc/stats-sdk-objc" ~> 2.2.2

After running carthage update --platform iOS follow the usual instructions for linking the frameworks. The Carthage README on Github walks through that and this guide is a good walkthrough.


If you are using the Google IMA integration there are a few extra steps. Your Cartfile will have these dependencies:

github "muxinc/mux-stats-sdk-avplayer" ~> 1.3.0
github "muxinc/stats-sdk-objc" ~> 2.2.0
github "muxinc/mux-stats-google-ima" ~> 0.5.0

In addition to specifying these dependencies in the Cartfile and linking them up, you will also need to follow Google's documentation for "Manually, using the SDK download".


App Store Warning: ITMS-90809: Deprecated API Usage

It has come up a few times that users of our iOS library get this warning from Apple.

Apple will stop accepting submissions of apps that use UIWebView APIs . See https://developer.apple.com/documentation/uikit/uiwebview for more information.

If you run grep -r "UIWebView" . in your project you will see a match coming from the dSYM/ directory in Mux-Core. At first glance, we too thought our SDK was triggering this warning.

However, after looking into this with several different applications we found that the warning was not being triggered by our SDK. In every case it was coming from another 3rd party.

Note that none of the Mux iOS libraries (including Mux-Core and Mux-Stats-AVPlayer) use UIWebView. If you are getting this warning you must have another sdk that is using UIWebView.

The reason there is some confusion around this and the reason you get a match in the dSYM/ directory in Mux-Core is because our SDK links to UIKit and targets a version of iOS that may include UIWebView. The dSYM files are used for debugging purposes and they do not contain any functional code. You may see that this same confusion came up in other SDKs like Mapbox and Stripe (listed below).

Resources


Release Notes

Current Release

v1.7.0

  • Adds support for view_session_id.
  • Adds support for player_remote_played - this will be true when a video is shown over Airplay.

Previous Releases

v1.6.0

  • Add viewer_connection_type for iOS (either "wifi" or "cellular"). Detecting viewer_connection type is done off the main thread to make sure this doesn't interfere with the performance of your application. Note that viewer_connection_type is omitted from TVOS because in versions before TVOS 12 there is no reliable way to detect "wifi" vs. "ethernet".

v1.4.1

  • (bugfix) monitorAVPlayerLayer with optional argument automaticErrorTracking was misnamed to withAutomaticErrorTracking. This has been changed to the correct name which is consistent with the corresponding monitorAVPlayerViewController method (thanks @hlung in #58)
  • (bugfix) nullability warnings for MUXSDKStats (thanks @hlung in #58)

v1.4.0

  • add option to disable automatic error tracking when calling either monitorAVPlayerViewController or monitorAVPlayerLayer
  • add MUXSDKStats.dispatchError method to manually dispatch an error

You probably will not need to use these features, but if your player is throwing noisy non-fatal errors or you want to catch the player errors yourself and take precise control over the error code and error message then you now have that ability.

Dispatching an error should only be used for fatal errors. When the player goes into the error state then it is no longer being tracked and the view will show up as errored in the Mux dashboard.

v1.3.8

  • Performance updates that optimize main thread usage.

v1.3.7

  • Bugfix: Update our framework build process to be compatible with carthage 0.35.0. See the github issue for more details. The gist of it is that Carthage no longer ignores dSYM files, so those need to be packaged up correctly with the framework.

v1.3.6

  • Bugfix: Rebuild frameworks without importing UIKit (we don't use it). This came to our attention when it was reported that our SDK was triggering this warning from Apple “The App Store will no longer accept new apps using UIWebView as of April 2020 and app updates using UIWebView as of December 2020.”

v1.3.5

  • Bugfix for usage with AVQueuePlayer. Unlike other methods of changing the playerItem on an AVPlayer instance, when AVQueuePlayer progresses from one item to the next the rate observer does not fire so we have to handle it in a special case. See instructions above for usage with AVQueuePlayer.

v1.3.4

  • Update scaling logic to report upscaling based on logical resolution, not physical resolution. This will result in lower upscaling percentages, but correlates more closely with perceived visual quality

v1.3.3

  • Fix a bug to make sure all needed header files are included in the tvOS framework

v1.3.2

  • Fix a bug in request metrics tracking, request metric event timestamps should always be sent in unix millisecond timestamps, not seconds.

v1.3.1

  • Fix an issue where multiple AVPlayer instances that are tracked simultaneously report the same throughput metrics.

v1.3.0

  • Add support for orientationchange events. This can be dispatched with MUXSDKStats orientationChangeForPlayer: withOrientation:
  • Add support for automatically tracking renditionchange events. You can see this new event in the events list for a view.
  • Improve implementation for bandwidth metrics calculation. Instead of polling for changes on the access log, use AVPlayerItemNewAccessLogEntryNotification
  • Fix bug in programChange so that it works consistently now
  • Dispatch viewend when destoryPlayer is called. Previously this was not called which didn't affect metrics, but resulted in a viewdropped event in the events list.

v1.2.1

  • Fix bug that prevents request metrics tracking from working. AVPlayer gives us requestStart and requestResponseEnd, so with those datapoints we can track throughput. This bugfix requires Mux-Stats-Core v2.1.3 or greater. Run pod update Mux-Stats-AVPlayer and pod update Mux-Stats-Core to get the latest versions.

v1.2.0

  • Fix bug in Mux-Stats-AVPlayer that prevents videoChangeForPlayer from working
  • Fix bug in AVPlayer SDK where it misses initial play event at times if SDK is initialized too late. This could cause some iOS views to not be displayed in the real-time dashboard, and to potentially have incomplete metrics such as Video Startup Time.
  • Add ability to optionally pass in new player data when calling videoChangeForPlayer: videoChangeForPlayer:withPlayerData:withVideoData

v1.1.3

  • Fix a bug to prevent an edge-case scenario where crashes can happen after calling destroyPlayer when observers have not yet bet set up on the player instance.

v1.1.2

  • bump dependency version of Mux-Stats-Core to 2.1

v1.1.1

  • bugfix - report the correct Mux Plugin Version. This sdk was erroneously reporting the incorrect 'Mux Plugin Version' attribute for views

v1.1.0

  • Added new static method to MUXSDKStats updateCustomerDataForPlayer:withPlayerData:withVideoData. This allows a developer to update customerPlayerData and/or customerVideoData after the sdk has been initialized. Not all metadata can be changed if it was previously set, but all metadata that was not set initially can be updated to the intended values.

v1.0.2

  • Fix a bug that caused slowness when loading AVPlayer due to checking currentItem.asset.duration before the duration was loaded

v1.0.1

  • Fix a bug with incorrect source video duration

v1.0.0

  • Extract GoogleAds-IMA-iOS-SDK into a separate library (Mux-Stats-Google-IMA). The reason for this change was to remove the hard dependency on GoogleAds-IMA-iOS-SDK
  • In order to implement ad events tracking, please follow the instructions to use this library (Mux-Stats-AVPlayer) in conjunction with Mux-Stats-Google-IMA and GoogleAds-IMA-iOS-SDK

0.1.5

  • add support for tracking ad playback with GoogleAds-IMA-iOS-SDK

0.1.1

  • add support for AVPlayer monitoring

Updated about a month ago

Integration Guide: AVPlayer


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.