Specify bitrate and media format

Select platform: HTML5 Android iOS tvOS

VAST responses can contain multiple media files with different bitrates and in different formats. The SDK chooses the appropriate bitrate based on the current network conditions:

  • max 500 kbit/s for cellular connection
  • unlimited for WiFi

Note: iOS does not provide any detailed information on the current network speed, so the iOS SDK tries to be conservative when on cellular connection.

If you want to specify preferred video formats and bitrate, use an IMAAdsRenderingSettings instance to pass this information at the time of Ads Manager initialization.

 - 
 ( 
 void 
 ) 
 adsLoader: 
 ( 
 IMAAdsLoader 
  
 * 
 ) 
 loader 
  
 adsLoadedWithData: 
 ( 
 IMAAdsLoadedData 
  
 * 
 ) 
 adsLoadedData 
  
 { 
  
 self 
 . 
 adsManager 
  
 = 
  
 adsLoadedData 
 . 
 adsManager 
 ; 
  
 self 
 . 
 adsManager 
 . 
 delegate 
  
 = 
  
 self 
 ; 
  
  IMAAdsRenderingSettings 
  
 * 
 settings 
  
 = 
  
 [[ 
 IMAAdsRenderingSettings 
  
 alloc 
 ] 
  
 init 
 ]; 
  
 settings 
 . 
 bitrate 
  
 = 
  
 1024 
 ; 
  
 // kbits 
  
 settings 
 . 
 mimeTypes 
  
 = 
  
 @[ 
  
 @"video/mp4" 
 , 
  
 @"application/x-mpegURL" 
 ] 
 ; 
  
 [ 
 self 
 . 
 adsManager 
  
 initializeWithContentPlayhead 
 : 
 nil 
  
 adsRenderingSettings 
 : 
 settings 
 ]; 
 } 
Create a Mobile Website
View Site in Mobile | Classic
Share by: