Documentation Index

Fetch the complete documentation index at: https://help.tritondigital.com/llms.txt

Use this file to discover all available pages before exploring further.

Usar el kit de desarrollo de software para iOS

Anterior Siguiente

La siguiente sección describe cómo realizar las tareas más comunes usando TritonMobileSdk. El paquete del kit de desarrollo de software incluye un proyecto de muestra de Xcode que presenta las funciones disponibles y muestra cómo integrar este kit en una aplicación de streaming.

Configure su región

Cuando se carga el SDK, obtiene su configuración de emisora de nuestros servicios de aprovisionamiento. Para acelerar el proceso, contamos con servidores de aprovisionamiento en diversas regiones, incluidas América del Norte, Europa y Asia. Para la obtención de mejores resultados, utilice los servidores de aprovisionamiento que se encuentran más cerca de sus estaciones.

La región de aprovisionamiento predeterminada es América del Norte; para usar una de las otras regiones, especifíquela según se observa en el siguiente ejemplo, en el que se utiliza "AP" (Asia).

NSDictionary *ajustes = @{ConfiguraciónNombreEstaciónKey : @"MOBILEFM",
                           ConfiguraciónEmisora Clave : @"Triton Digital",
                           ConfiguraciónClave de Montar : @"MOBILEFM_AACV2",
                           ConfiguraciónPlayerServicesRegion: @"AP", // AP = Asia | UE = Europa | Omite esta opción de configuración para Norteamérica
                           }; 
 
self.tritonPlayer = [[TritonPlayer alloc] initWithDelegate:self andSettings:settings]; 
 
... 
 
[self.tritonPlayer jugar];

Reproducción automática

Por razones de medición, así como por la experiencia del usuario, se desaconseja encarecidamente el uso de la reproducción automática. La reproducción automática se define como la emisora o el stream que se reproduce sin ninguna interacción del usuario para iniciar la reproducción. Si implementa una estrategia de reproducción automática, necesita añadir el valor autoplay = 1 al objeto SettingsStreamParamsExtraKey al activar la función play en el kit de desarrollo de software.

NSDictionary *ajustes = @{ConfiguraciónNombreEstaciónKey : @"MOBILEFM",                           ConfiguraciónClaveTransmisor: @"Triton Digital",                           ConfiguraciónClaveMontaje : @"MOBILEFM_AACV2",                           ConfiguraciónEnableLocalizaciónSeguimientoKey : @(SÍ),                           SettingsStreamParamsExtraKey : @{@"autoplay": @"1",                                                           @"age": @"30"}                         }; self.tritonPlayer = [[TritonPlayer alloc] initWithDelegate:self ySettings:settings]; ... [auto.tritonPlayer jugar];

Reproducir una estación

La funcionalidad de stream es proporcionada por la clase TritonPlayer. Para poder reproducir contenido, debe proporcionar las configuraciones de su estación; como mínimo, brinde el nombre y montaje de la estación y la emisora. Se admiten los montajes HLS. Contacte a Triton Digital si no tiene esta información. Consulta la Referencia API para otras configuraciones disponibles.

NSDictionary *ajustes = @{ConfiguraciónNombreEstaciónKey : @"MOBILEFM",                           ConfiguraciónBroadcasterKey : @"Triton Digital",                           ConfiguraciónMountKey : @"MOBILEFM_AACV2",                           ConfiguraciónDebouncingKey: @(0,75) // debouncing opcional para la acción Play, en segundos: el valor por defecto es 0,2                           }; self.tritonPlayer = [[TritonPlayer alloc] initWithDelegate:self andSettings:settings]; ... [self.tritonPlayer jugar];

Cómo cambiar de estación

Al cambiar de estación, necesita proporcionar las configuraciones de la nueva estación. Use el método -updateSettings: para configurarla. Esto anulará las configuraciones anteriores, pero solo será efectivo la próxima vez que el reproductor se detenga y vuelva a reproducir.

Detener el stream anterior
[self.tritonPlayer detener]; ... // Configurar y reproducir la nueva emisora
NSDictionary *settings = @{SettingsStationNameKey : @"WMSC_S01",                           SettingsBroadcasterKey : @"Triton Digital",                           SettingsMountKey : @"WMSC_S01AAC"                           }; [self.tritonPlayer updateSettings:settings]; [auto.tritonPlayer jugar];

Como alternativa, puede recrear el TritonPlayer cada vez que cambia de estación, pero se recomienda el procedimiento detallado arriba.

Cómo cambiar la velocidad de reproducción del podcast

Para cambiar la velocidad de reproducción de un podcast, usa changePlaybackRate con un valor flotante como argumento de velocidad.

Este ejemplo cambia la velocidad de reproducción a 1,5 veces la velocidad original:

(void)setPlaybackRate:{ 
       [self.tritonPlayer changePlaybackRate:1,50]; 
}

Cómo hacer streaming mientras está silenciado

Puedes configurar el comportamiento del stream mientras el reproductor está silenciado.

SettingsStreamWhileMuted (Objeto). Obligatorio: No.

Utilice este objeto para activar o desactivar la reproducción continua del stream cuando el usuario silencia el audio. El valor predeterminado es NO.

Opciones:

  • NO - Desactivado (el stream se detiene cuando se silencia)

  • YES - Activado (el stream continúa cuando está silenciado, pero el usuario no escucha el audio)

Ejemplo de código:

NSDictionary *ajustes = @{ConfiguraciónNombreEstaciónKey : @"MOBILEFM",                           ConfiguraciónEmisora Clave : @"Triton Digital",                           ConfiguraciónClave de Montar : @"MOBILEFM_AACV2",                   ConfiguraciónStreamWhileMuted: @(NO) //Steam se detendrá cuando esté en silencio.                           }; self.tritonPlayer = [[TritonPlayer alloc] initWithDelegate:self ySettings:settings]; ... [auto.tritonPlayer jugar];  

Audiencia objetivo para anuncios de audio

Para direccionar su audiencia con anuncios de audio y sus respectivos banners complementarios, debe transferir los parámetros de direccionamiento a las configuraciones de TritonPlayer. El siguiente ejemplo se dirige a hombres de 30 años y proporciona sus coordenadas de localización. Para ver detalles sobre los parámetros bundle-id, store-id, y store-url, consulte la sección Información de dispositivos/reproductor.

NSDictionary *ajustes = @{   ConfiguraciónEstaciónNombreKey : @"MOBILEFM",   ConfiguraciónBroadcasterKey : @"Triton Digital",   ConfiguraciónMountKey : @"MOBILEFM_AACV2",   ConfiguraciónEnableLocationTrackingKey : @(SÍ),   ConfiguraciónStreamParamsExtraKey : @{       // Requerido: bundle-id, store-id, store-url       @"bundle-id" : @"com.companyname.app",       @"store-id" : @"1234567890",       @"store-url" : [@"https://apps.apple.com/us/app/demoapp/id1234567890" stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]],       // Objetivo específico       @"gender" : @"m",       @"age" : @"30"   }
}; self.tritonPlayer = [[TritonPlayer alloc] initWithDelegate:self ySettings:settings]; ... [auto.tritonPlayer jugar];

Cuando SettingsEnableLocationTrackingKey está configurado en YES, se utiliza CLLocationManager para proporcionar la ubicación del usuario (ver "Rastreo de ubicación"). Los otros parámetros, incluida la ubicación manual, se especifican en un diccionario en SettingsStreamParamsExtraKey. Para ver todos los parámetros de segmentación disponibles, consulte la Guía de streaming de Triton Digital.

Puede añadir encabezados de segmentos de DMP (tal y como se describe en la Especificación Técnica de Publicidad) para streaming en vivo, podcast y a demanda si agrega lo siguiente a la configuración del reproductor, usando ejemplos de DMP de Permutive y Adobe:

SettingsDmpHeadersKey : @{@"permutive": @[@1234,@5679], @"adobe": @[@4321,@8765]},

Por ejemplo:

NSDictionary *settings = @{SettingsStationNameKey : @"MOBILEFM",
                           SettingsBroadcasterKey : @"Triton Digital",
                           SettingsMountKey : @"MOBILEFM_AACV2",
                           SettingsDmpHeadersKey : @{@"permutive": @[@1234,@5679], @"adobe": @[@4321,@8765]},
                           SettingsDebouncingKey: @(0,75) // optional debouncing for the Play action, in seconds : default value is 0,20
                           };
 
self.tritonPlayer = [[TritonPlayer alloc] initWithDelegate:self andSettings:settings];
...
 
[self.tritonPlayer play];

Autorización de token (Autofirmado)

Para la recreación de los tokens al reconectarse al trabajo, se requieren cualquiera de los siguientes parámetros:

  • StreamParamExtraAuthorizationSecretKey

  • StreamParamExtraAuthorizationKeyId

Si se completan todos los parámetros, entonces no es necesario que genere el token usted mismo (aunque puede hacerlo si lo desea).

Crear los parámetros de segmentación
NSDictionary *targetingParams = @{@"gender": @"m",                                   @"age": @"30"                                 }; // Create the authorization token
NSString *token = [TDAuthUtils createJWTTokenWithSecretKey:@"MySecretKey"         andSecretKeyId:@"MySecretKeyId" andRegisteredUser:YES andUserId:@"foo@bar.com" andTargetingParameters:targetingParams]; // Crea la configuración del jugador.
NSDictionary *settings = @{SettingsStationNameKey : @"BASIC_CONFIG",
                               SettingsBroadcasterKey : @"Triton Digital",
                               SettingsMountKey : self.playerViewController.mountName,
                               SettingsEnableLocationTrackingKey : @(YES),
                               SettingsStreamParamsExtraKey : @{@"banners": @"300x50,320x50"},
                               SettingsTtagKey : @[@"mobile:ios", @"triton:sample"],
                               StreamParamExtraAuthorizationSecretKey: @"4ToEMVkOK1sThhsw",
                               StreamParamExtraAuthorizationUserId: @"",
                               StreamParamExtraAuthorizationKeyId: @"DG83J",
                               StreamParamExtraAuthorizationRegisteredUser: @(YES),
                               };
    [self.tritonPlayer updateSettings:settings];
}
 
// Create the player.
self.tritonPlayer = [[TritonPlayer alloc] initWithDelegate:self andSettings:settings];
[self.tritonPlayer play];

Recibir metadatos de stream (puntos de referencia)

Una vez que el reproductor está haciendo streaming, es capaz de recibir puntos de referencia con metadatos del stream (por ejemplo, canción en reproducción, metadatos de anuncios, etc.). Para recibir puntos de referencia, necesita implementar -player:didReceiveCuePointEvent: de TritonPlayerDelegate en la clase que será el delegado de TritonPlayer. CuePointEvent.h define todas las constantes para los tipos de puntos de referencia y las claves para recuperar su información.

@interface ViewController() <TritonPlayerDelegate> 
@end
 
@implementation ViewController
...
- (void)viewDidLoad {
    [super viewDidLoad];
    ...
    self.tritonPlayer = [[TritonPlayer alloc] initWithDelegate:self andSettings:settings];
}
 
...
[self.tritonPlayer play];
...
 
- (void)player:(TritonPlayer *)player didReceiveCuePointEvent:(CuePointEvent *)cuePointEvent {
     
    // Check if it's an ad or track cue point
    if ([cuePointEvent.type isEqualToString:EventTypeAd]) {
        // Handle ad information (ex. pass to TDBannerView to render companion banner)
 
    } else if ([cuePointEvent.type isEqualToString:EventTypeTrack]) {
        NSString *currentSongTitle = [inNowPlayingEvent.data objectForKey:CommonCueTitleKey];
        NSString *currentArtistName = [inNowPlayingEvent.data objectForKey:TrackArtistNameKey];
        NSString *currentAlbumName = [inNowPlayingEvent.data objectForKey:TrackAlbumNameKey];
         
        // Do something with track data (update interface, notify user etc.)
    }
}
...
@end

Cómo mostrar un banner complementario In-Stream (sincronizar banner)

@interface ViewController() <TritonPlayerDelegate> 
@property (strong, nonatomic) TDSyncBannerView *adBannerView;
@end
  
@implementation ViewController
...
- (void)viewDidLoad {
    [super viewDidLoad];
    ...
    self.tritonPlayer = [[TritonPlayer alloc] initWithDelegate:self andSettings:settings];
 
    // Create and configure a 320x50 sync banner with a fallback size of 300x50
    self.adBannerView = [[TDSyncBannerView alloc] initWithWidth:320 andHeight:50 andFallbackWidth:300 andFallbackHeight:50];
    [self.view addSubview:self.adBannerView];
}
...
- (void)player:(TritonPlayer *)player didReceiveCuePointEvent:(CuePointEvent *)cuePointEvent {
     
    if ([cuePointEvent.type isEqualToString:EventTypeAd]) {
        [self.adBannerView loadCuePoint:cuePointEvent];
    } 
    ...
}    
...

Mostrar un anuncio intersticial

Los anuncios intersticiales, pre-rolls y mid-rolls, son anuncios a pantalla completa que se muestran en diseño modal en una aplicación. Normalmente se muestran en puntos naturales de transición de la aplicación, como antes o después de reproducir o cambiar de estación de radio.

// Create a TDAdRequestBuilder to build the request string
TDAdRequestURLBuilder *request = [TDAdRequestURLBuilder builderWithHostURL:kRequestUrl];
request.stationId = 12345;
 
// Create a TDInterstitialAd
self.interstitial = [[TDInterstitialAd alloc] init];
 
// Create a TDAdLoader to load the ad from the request
self.adLoader = [[TDAdLoader alloc] init];
[self.adLoader loadAdWithBuilder:requestBuilder completionHandler:^(TDAd *loadedAd, NSError *error) {
        if (error) {
            // Handle error
        } else {
            // Load the ad into the interstitial
            [self.videoInterstitial loadAd:loadedAd];
        }
    }
];

Una vez cargado el anuncio intersticial, debe mostrarse en el momento adecuado. La aplicación debe comprobar si el intersticial está cargado antes de intentar mostrarlo. Si -loaded no devuelve YES, el anuncio no se mostrará. Al mostrar un intersticial, se debe pasar un controlador de vista. Será el controlador de vista de la presentación del intersticial.

- (void)playStation {
  if ([self.interstitial loaded]) {
    [self.interstitial presentFromViewController:self];
  }
  // Rest of method logic
}

Puede agregar un cronómetro opcional de cuenta regresiva para que se muestre en un anuncio intersticial. Para ello, active la propiedad CountdownDisplay como se muestra en el ejemplo intersticial de video a continuación:

// Create a TDAdRequestBuilder to build the request string
TDAdRequestURLBuilder *request = [TDAdRequestURLBuilder builderWithHostURL:kRequestUrl];
request.stationId = 12345;
 
 // Create a TDInterstitialAd
self.videoInterstitial = [[TDInterstitialAd alloc] init];
self.videoInterstitial.enableCountdownDisplay = TRUE;
// Create a TDAdLoader to load the ad from the request
 
self.adLoader = [[TDAdLoader alloc] init];
[self.adLoader loadAdWithBuilder:requestBuilder completionHandler:^(TDAd *loadedAd, NSError *error) {
    if (error) {
       // Handle error
    } else {
      // Load the ad into the interstitial
      [self.videoInterstitial loadAd:loadedAd];
    }
 
    }
 
];

Puede añadir encabezados de segmentos de DMP​​​​​​​ (tal y como se describe en la Especificación Técnica de Publicidad) a los anuncios intersticiales de la siguiente manera (usando ejemplos de DMP de Permutive y Adobe):

requestBuilder.dmpSegments = @{@"permutive": @[@1234,@5679], @"adobe": @[@4321,@8765]}

Por ejemplo:

// Create a TDAdRequestBuilder to build the request string
TDAdRequestURLBuilder *requestBuilder = [TDAdRequestURLBuilder builderWithHostURL:kRequestUrl];
 
//Add DMP Segments
requestBuilder.dmpSegments = @{@"permutive": @[@1234,@5679], @"adobe": @[@4321,@8765]};
 
requestBuilder.stationId = 12345;
 
// Create a TDInterstitialAd
self.interstitial = [[TDInterstitialAd alloc] init];
 
// Create a TDAdLoader to load the ad from the request
self.adLoader = [[TDAdLoader alloc] init];
[self.adLoader loadAdWithBuilder:requestBuilder completionHandler:^(TDAd *loadedAd, NSError *error) {
        if (error) {
            // Handle error
        } else {
            // Load the ad into the interstitial
           [self.videoInterstitial loadAd:loadedAd];
        }
    }
];

También puede especificar bundle-id, store-id y store-url para anuncios intersticiales.

Ejemplo:

TDAdRequestURLBuilder *requestBuilder = [TDAdRequestURLBuilder builderWithHostURL:kRequestUrl];
requestBuilder.stationId = 12345;

// Add bundle-id, store-id and store-url
requestBuilder.bundleId = @"com.tritondigital.tritonradio";
requestBuilder.storeId  = @"1234567890";
requestBuilder.storeUrl = [@"https://apps.apple.com/us/app/demoapp/id1234567890" stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
 
// Create a TDInterstitialAd
self.interstitial = [[TDInterstitialAd alloc] init];
 
// Create a TDAdLoader to load the ad from the request
self.adLoader = [[TDAdLoader alloc] init];
[self.adLoader loadAdWithBuilder:requestBuilder completionHandler:^(TDAd *loadedAd, NSError *error) {
        if (error) {
            // Handle error
        } else {
            // Load the ad into the interstitial
           [self.videoInterstitial loadAd:loadedAd];
        }
    }
];

TTags personalizadas - Reproductor

Las TTags personalizadas ((p. ej., mobile:ford) se pueden aplicar a los URL de streaming al agregar varias de ellas al parámetro de configuración SettingsTtagKey .

Ejemplo de TTags personalizadas - Reproductor

NSDictionary *settings = @{SettingsStationNameKey : @"MOBILEFM",
                           SettingsBroadcasterKey : @"Triton Digital",
                           SettingsTtagKey : @[@"mobile:ios",@"chips:salsa"],
                           SettingsMountKey : @"MOBILEFM_AACV2"
                           };
 
self.tritonPlayer = [[TritonPlayer alloc] initWithDelegate:self andSettings:settings];
 
...
 
[self.tritonPlayer play];

TTags personalizadas - Anuncio intersticial

Las TTags personalizadas (p. ej., mobile: ford) se pueden aplicar a los URL de anuncios intersticiales al agregar las TTags NSArray al objeto TDAdRequestURLBuilder.

TTags personalizadas - Ejemplo de anuncio intersticial

// Create a TDAdRequestBuilder to build the request string
TDAdRequestURLBuilder *request = [TDAdRequestURLBuilder builderWithHostURL:kRequestUrl];
request.stationId = 12345;
request.TTags = @[ "mobile:ios", "cola:diet" ];
 
// Create a TDInterstitialAd
self.interstitial = [[TDInterstitialAd alloc] init];
 
// Create a TDAdLoader to load the ad from the request
self.adLoader = [[TDAdLoader alloc] init];
[self.adLoader loadAdWithBuilder:requestBuilder completionHandler:^(TDAd *loadedAd, NSError *error) {
        if (error) {
            // Handle error
        } else {
            // Load the ad into the interstitial
            [self.videoInterstitial loadAd:loadedAd];
        }
    }
];

Múltiples ID de Oyentes

Proporciona una forma de enviar múltiples identificadores de usuario o dispositivo, además del ID de oyente principal (parámetro lsid). Este último sigue siendo utilizado por Triton para limitación de frecuencia, mediciones, etc., mientras que los otros ID pueden proporcionarse a plataformas de demanda de terceros para mejorar la monetización.

Los valores para StreamParamExtraListenerIdType son:

  • ppid

  • idfa

  • gaid

  • aplicación

El valor para StreamParamExtraListenerIdValue puede ser lo que usted decida.

Ejemplo:

NSDictionary *settings = @{
    SettingsStationNameKey : @"BASIC_CONFIG",
    SettingsBroadcasterKey : @"Triton Digital",
    SettingsMountKey : @"TRITONRADIOMUSIC",
    SettingsEnableLocationTrackingKey : @(YES),
    SettingsStreamParamsExtraKey : @{@"banners": @"300x50,320x50"},
    SettingsTtagKey : @[@"mobile:ios", @"triton:sample"],
    // Using PPID
    StreamParamExtraListenerIdType: @"ppid",
    StreamParamExtraListenerIdValue: @"550e8400-e29b-41d4-a716-446655443658",                              
};
[self.tritonPlayer updateSettings:settings];
[self.tritonPlayer play];

Baja demora con almacenamiento adaptable

Cuando se configura en -1 / MODO AUTO el kit de desarrollo de software usa una pequeña ventana de almacenamiento intermedio (dos segundos) durante la conexión inicial, lo que reduce la demora entre la reproducción y el tiempo real. (Esto resulta útil para eventos deportivos, concursos en vivo, etc.)

Debido a que la conexión tiene una pequeña ventana de almacenamiento intermedio, si la red se congestiona o el ancho de banda es bajo, el buffer se duplicará si el dispositivo no puede mantener la conexión apropiada.

Cuando se configura con un valor mayor a cero (>0), el kit de desarrollo de software almacenará esos segundos de audio antes de comenzar la reproducción.

Use SettingsLowDelayKey con un objeto NSNumber para esta función. Valores válidos: -1 (modo AUTO), 0 (Desactivado​​​​​​​), 2 a 60 segundos.

Por defecto, la función está desactivada ( 0 ).

Ejemplo de baja demora en iOS

NSNumber *delayValue = [NSNumbernumberWithInt:2];
NSDictionary *settings = @{SettingsStationNameKey : @"MOBILEFM",
                           SettingsBroadcasterKey : @"Triton Digital",
                           SettingsLowDelayKey : delayValue,
                           SettingsMountKey : @"MOBILEFM_AACV2"
                           };
 
self.tritonPlayer = [[TritonPlayer alloc] initWithDelegate:self andSettings:settings];
 
...
 
[self.tritonPlayer play]; 

Cómo recibir información de "Historial de reproducción en curso"

TDCuePointHistory se utiliza para acceder a la información de "Historial de reproducción en curso" de los servidores de Triton. Devuelve una lista de CuePointEvents de un montaje específico. También permite especificar los filtros y limitar la cantidad máxima de elementos devueltos.

@property (strong, nonatomic) TDCuePointHistory *cuePointHistory;
...
 NSString *mount = @"MOBILEFM_AACV2";
 NSInteger maxItems = 20;
 NSArray *filter = @[EventTypeTrack, EventTypeAd];
   
 // Request the history list from the server. The result will be a NSArray of CuePointEvent objects.
 [self.cuePointHistory requestHistoryForMount:mount withMaximumItems:maxItems eventTypeFilter:filter completionHandler:^(NSArray *historyItems, NSError *error) {
     if (error) {
         // Handle the error
     }
 
     // Process the cue point list. Ex. display them in a UITableView
     self.cuePointList = historyItems;
     [self.tableView reloadData];
     ...
 }];

Timeshift

Para más información sobre Timeshift Radio, consulte la sección Especificación de Streaming.

Para usar Timeshift, necesita usar un montaje que esté habilitado para Timeshift.

NSDictionary *settings = @{SettingsStationNameKey : @"BASIC_CONFIG",
                               SettingsBroadcasterKey : @"Triton Digital",
                               SettingsMountKey : TRITONRADIOMUSICAAC_RW,
                               SettingsEnableLocationTrackingKey : @(YES),
                               SettingsTtagKey : @[@"mobile:ios", @"triton:sample"],
                               StreamParamExtraListenerIdType: @"idfa",
                               StreamParamExtraListenerIdValue: @"triton-app-id",
                               };

Cómo buscar hacia adelante o hacia atrás

  • Añadir o eliminar tiempo del tiempo de reproducción actual.

  • Para buscar hacia adelante , utilice un NSTimeInterval positivo .

  • Para buscar hacia atrás , utilice un NSTimeInterval negativo .

[self.tritonPlayer seekToTimeInterval:self.tritonPlayer.currentPlaybackTime - 30,00];
Example:
//Seek forward
    self.playerViewController.forwardFiredBlock = ^(UIButton *button) {        
        [self.tritonPlayer seekToTimeInterval:self.tritonPlayer.currentPlaybackTime + 10,00];
    };

Ir al punto en vivo

Para volver al streaming en vivo, use seekToLive. Esto detendrá el stream de Timeshift y se conectará de nuevo con el streaming en vivo.

[self.tritonPlayer seekToLive]

Cómo obtener información de Cloud Stream

Para obtener información de Cloud Stream, active el método getCloudStreamInfo e implemente el didReceiveCloudStreamInfoEvent desde TritonPlayerDelegate para recibir la devolución. Tenga en cuenta que para que esto funcione, el stream de Timeshift tiene que reproducirse. Estamos trabajando en una solución que lo permita en cualquier momento.

self.playerViewController.getCloudStreamInfoFiredBlock = ^(UIButton *button) {
        [self.tritonPlayer getCloudStreamInfo];
    };
    
    
- (void)player:(TritonPlayer *)player didReceiveCloudStreamInfoEvent:(NSDictionary *)cloudStreamInfoEvent {
    NSObject *programs = [cloudStreamInfoEvent valueForKey:@"programs"];
    if([programs isKindOfClass:[NSDictionary class]]){
        NSObject *properties = [(NSDictionary *)programs valueForKey:@"properties"];
        NSString *title = [(NSDictionary *)properties valueForKey:@"program_title"];
        dispatch_async(dispatch_get_main_queue(), ^{
            self.playerViewController.btnTimeshiftProgram.enabled = YES;
            self.playerViewController.btnTimeshiftProgram.hidden = NO;
            [self.playerViewController.btnTimeshiftProgram setTitle:title forState:UIControlStateNormal];
            self.cloudProgramId = [(NSDictionary *)programs valueForKey:@"program_episode_id"];
         });
       
    } else {
        dispatch_async(dispatch_get_main_queue(), ^{
            self.playerViewController.btnTimeshiftProgram.enabled = NO;
            self.playerViewController.btnTimeshiftProgram.hidden = NO;
            [self.playerViewController.btnTimeshiftProgram setTitle:@"No Programs" forState:UIControlStateNormal];
         });
    }
}

Cómo reproducir un programa

Para reproducir un programa específico, active playCloudProgram con el program_episode_id como parámetro.

self.playerViewController.timeshiftProgramFiredBlock = ^(UIButton *button) {
        [self.tritonPlayer playCloudProgram:self.cloudProgramId];
    };

Parámetro Dist

Para usar el parámetro dist con Timeshift es necesario añadir ambos parámetros de timeshifting:

SettingsStreamParamsExtraKey : @{StreamParamExtraDist:@"the-dist",
                         StreamParamExtraDistTimeshift:@"timeshift-dist”}

  • El parámetro StreamParamExtraDist:@"the-dist", se utiliza cuando el stream está en modo vivo .

  • El parámetro StreamParamExtraDistTimeshift:@"timeshift-dist", se utiliza cuando el stream está en modo Timeshift .

A continuación se muestra un ejemplo de cómo añadir los parámetros:

NSDictionary *settings = @{SettingsStationNameKey : @"MOBILEFM",
                 SettingsBroadcasterKey : @"Triton Digital",
                 SettingsMountKey : @"MOBILEFM_AACV2",
                 SettingsStreamParamsExtraKey : @{
                          StreamParamExtraDist:@"the-dist",
                          StreamParamExtraDistTimeshift:@"timeshift-dist"       
                 },
            };

self.tritonPlayer = [[TritonPlayer alloc] initWithDelegate:self andSettings:settings];

...

[self.tritonPlayer play];





© 2026 Triton Digital. Todos los derechos reservados.