Resumen
En versiones anteriores de Brightcove Native SDK para Android, int y Integer los tipos de datos se usaron para manejar los valores de la posición del cursor de reproducción (incluida la posición de búsqueda) y la duración del video.
Con Native SDK para Android versión 6.18.0, nos hemos alineado con el ExoPlayer librería para manejar estos valores. El SDK nativo ha migrado de usar int y Integer tipos de datos a long y Long tipos de datos.
Desaprobación y reemplazo
Esta migración implica dos procesos:
- Desprecio de todos
intyIntegerreferencias de valor de duración y posición del cursor de reproducción, en miembros de clase y métodos - Creación de nuevos miembros de clase y métodos con un
Longposfijo en sus nombres
Ejemplos
Estos son algunos ejemplos de esta desaprobación y reemplazo:
En el ExoPlayerVideoDisplayComponent :
- Obsoleto:
videoDisplayComponent.getLiveEdge() - Nuevo:
videoDisplayComponent.getLiveEdgeLong()
En el Video clase:
- Obsoleto:
video.getDuration() - Nuevo:
video.getDurationLong()
Requisitos
Los siguientes requisitos son necesarios para esta función:
- SDK nativo de Brightcove para Android 6.18.0 o superior
Uso de los nuevos tipos de datos
Aunque Brightcove Native SDK para Android aún admite el uso de tipos enteros, el reemplazo de estos marca un punto de inflexión para las nuevas versiones. Por lo tanto, recomendamos implementar estos reemplazos en sus proyectos en el futuro.
Ejemplos
Estos son algunos ejemplos de los nuevos miembros y métodos:
Escuche la posición del cursor de reproducción y la duración del video
Map<String, Object> properties = new HashMap<>();
properties.put(Event.PLAYHEAD_POSITION_LONG, exoPlayer.getCurrentPosition());
properties.put(Event.VIDEO, getCurrentVideo());
eventEmitter.emit(EventType.DID_STOP, properties);
Obtener la posición actual del cursor de reproducción
long position = event.getLongProperty(Event.PLAYHEAD_POSITION_LONG);
O
long position = brightcoveVideoView.getVideoDisplay().getPlayerCurrentPosition();
Obtener la duración del video
long duration = videoView.getVideoDisplay().getCurrentVideo().getDurationLong();
O
long duration = event.getLongProperty(Event.VIDEO_DURATION_LONG);
Clases y métodos en desuso
Los siguientes miembros de clase y métodos ahora están en desuso:
AbstractEvent clase
PLAYHEAD_POSITIONPROGRESS_BAR_PLAYHEAD_POSITIONORIGINAL_PLAYHEAD_POSITIONVIDEO_DURATIONSEEK_DEFAULTSEEK_POSITIONSEEK_PROGRESSFROM_SEEK_POSITIONRESTORE_SEEK_POSITIONORIGINAL_SEEK_POSITIONMIN_POSITIONMAX_POSITIONLIVE_WINDOW_DURATIONSTART_TIMEEND_TIME
BaseVideoView clase
durationplayheadPositiongetDuration()getCurrentPosition()seekTo(int position)
VideoDisplayComponent clase
playheadPositiongetLiveEdge()
ExoPlayerVideoDisplayComponent clase
getLiveEdge()
GooglecastComponent clase
CAST_MEDIA_PLAY_POSITION
GoogleIMAComponent clase
setAdPosition(int position)getContentPosition()setContentPosition(int position)
OmnitureComponent clase
play(Integer position)play(Integer position, boolean shouldIgnoreState)stopPlayback(Integer position)stopPlayback(Integer position, boolean shouldIgnoreState)
BrightcoveClosedCaption clase
Brightcove(int beginTime, int endTime, List<List<Span>> testLines)Brightcove(int beginTime, int endTime, String caption)getTimeRange()
TTMLParser clase
parseTimeValue(String value)
BrightcoveMediaController clase
getSeekBarOffset()
BrightcoveSeekBarController clase
getSeekBarOffset()setSeekBarOffset(int offset)
MediaControllerConfig clase
setInitialDuration(int initialDuration)setInitialPlayheadPosition(int initialPlayheadPosition)getInitialDuration()getInitialPlayheadPosition()
SeekButtonController clase
seekDefaultseekStartPositionseekTargetPositiongetSeekDefault()setSeekDefault()computeTargetSeekPosition()
Block clase
beginTimeendTimegetBeginTime()setBeginTime(Integer beginTime)getEndTime()setEndTime(Integer endTime)
CuePoint clase
CuePointType(int position, String type, Map<String, Object> properties)CuePointType(int position, CuePointType type, Map<String, Object>)getPosition()
Video clase
getDuration()
Video.Field clase
duration
BrightcoveClosedCaptioningView clase
TreeMap<Integer, ArrayList<TimeMapEntry>> captionsPerSecondMapSparseArray<StringBuilder> currentCaptionBlockArrayint lastProgressTimefindCaptionsForPosition(int position)refreshCaptions(int seekToTime)