Monitor QoS Statistics

You can monitor QoS statistics by using an NSTimer (or other methods) to scan the information provided by PTQOSProvider.

To monitor QoS statistics with a PTQOSProvider:
  1. Create the PTQOSProvider instance. For example:
    qosProvider = [[PTQOSProvider alloc]initWithPlayer:self.player]; 
    PTDeviceInformation *devInfo = qosProvider.deviceInformation;
    if (devInfo) {
        [consoleView logMessage:@"=== qosDeviceInfo:==\n os =%@\n model = 
           %@\n id =%@\n\n", devInfo.os, devInfo.model, devInfo.id];
    }
    [NSTimer scheduledTimerWithTimeInterval:2.0 target:self 
       selector:@selector(printPlaybackInfoLog) userInfo:nil repeats:YES];
    
    
  2. Read the values provided by the PTQOSProvider. For example:
    - (void)printPlaybackInfoLog {
        PTPlaybackInformation *playbackInfo = qosProvider.playbackInformation; 
        if (playbackInfo) {
            // For example:
            NSString *infoLog = [NSString stringWithFormat:@"observedBitrate : 
                                   %f\n",playbackInfo.observedBitrate];
            [consoleView logMessage:@"====%@\n\n",infoLog];
        }
    }