Class OutStreamVideoAdPlayback
-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback,android.view.KeyEvent.Callback,android.view.ViewManager,android.view.ViewParent,android.view.accessibility.AccessibilityEventSource
public final class OutStreamVideoAdPlayback extends FrameLayout
An implementation for the outstream ads.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceOutStreamVideoAdPlayback.BufferingOrThumbnailVisibleOption
-
Constructor Summary
Constructors Constructor Description OutStreamVideoAdPlayback(Context context, AttributeSet attrs, Integer defStyleAttr)Constructs a new OutStreamVideoAdPlayback instance. OutStreamVideoAdPlayback(Context context, AttributeSet attrs)Constructs a new OutStreamVideoAdPlayback instance. OutStreamVideoAdPlayback(Context context)Constructs a new OutStreamVideoAdPlayback instance.
-
Method Summary
Modifier and Type Method Description UnitonMeasure(Integer widthMeasureSpec, Integer heightMeasureSpec)final Unitinitialize(VideoAdsRequest adsRequest, VideoProgressUpdate adProgress, BufferDurationsMs bufferDurationsMs, OutStreamVideoAdPlayback.BufferingOrThumbnailVisibleOption bufferingOrThumbnailVisibleOption, Integer dimmedColor, Boolean ended)주어진 adsRequest와 adProgress를 기반으로 이 인스턴스를 초기화하고 videoPlayer를 준비합니다. final Unitinitialize(VideoAdsRequest adsRequest, VideoProgressUpdate adProgress, BufferDurationsMs bufferDurationsMs, OutStreamVideoAdPlayback.BufferingOrThumbnailVisibleOption bufferingOrThumbnailVisibleOption, Integer dimmedColor)주어진 adsRequest와 adProgress를 기반으로 이 인스턴스를 초기화하고 videoPlayer를 준비합니다. final Unitinitialize(VideoAdsRequest adsRequest, VideoProgressUpdate adProgress, BufferDurationsMs bufferDurationsMs, OutStreamVideoAdPlayback.BufferingOrThumbnailVisibleOption bufferingOrThumbnailVisibleOption)주어진 adsRequest와 adProgress를 기반으로 이 인스턴스를 초기화하고 videoPlayer를 준비합니다. final Unitinitialize(VideoAdsRequest adsRequest, VideoProgressUpdate adProgress, BufferDurationsMs bufferDurationsMs)주어진 adsRequest와 adProgress를 기반으로 이 인스턴스를 초기화하고 videoPlayer를 준비합니다. final Unitinitialize(VideoAdsRequest adsRequest, VideoProgressUpdate adProgress)주어진 adsRequest와 adProgress를 기반으로 이 인스턴스를 초기화하고 videoPlayer를 준비합니다. final Unitinitialize(VideoAdsRequest adsRequest)주어진 adsRequest와 adProgress를 기반으로 이 인스턴스를 초기화하고 videoPlayer를 준비합니다. final Unitinitialize(VideoAdsRequest adsRequest, VideoProgressUpdate adProgress, Integer backBufferDurationMillis, OutStreamVideoAdPlayback.BufferingOrThumbnailVisibleOption bufferingOrThumbnailVisibleOption, Integer dimmedColor, Boolean ended)주어진 adsRequest와 adProgress를 기반으로 이 인스턴스를 초기화하고 videoPlayer를 준비합니다. final Unitdestroy()Destroys this OutStreamVideoAdPlayback. final Unitmute(Boolean mute)Sets the mute state of the current audio stream. final BooleanseekTo(Long positionMillis)Moves the ads to specified time position. final Unitstop(VideoAdsManager adsManager)Stops current playback. final Unitsuspend(VideoAdsManager adsManager)Suspends current playback. final Unitrestore(VideoAdsManager adsManager, Boolean forcePlayWhenReady)Restores the player based on the saved states and resume it. final Unitrestore(VideoAdsManager adsManager)Restores the player based on the saved states and resume it. final UnitshowOverlayView()Shows the overlay view. final UnithideOverlayView()Hides the overlay view. final VideoAdDisplayContainergetAdDisplayContainer(CompanionAdSlot companionAdSlot)Creates and returns a VideoAdDisplayContainer with the given companionAdSlot. final VideoAdDisplayContainergetAdDisplayContainer()Creates and returns a VideoAdDisplayContainer with the given companionAdSlot. final BooleangetPlayWhenReady()Whether playback will proceed when playbackState is PlaybackState.PREPARED. final VideoProgressUpdategetAdProgress()Returns VideoProgressUpdate describing playback progress of the current ad or VideoProgressUpdate.NOT_READY if video details are not yet available. final BooleanisMuted()Returns the mute state of the current audio stream. final BooleanisPlaying()Returns whether the player is playing. final BooleanisEnded()Whether the current ad has reached the end of the media or not. final AudioFocusManagergetAudioFocusManager()final UnitsetAspectRatio(Float aspectRatio)Sets the new aspect ratio to the texture view. final UnitsetResizeType(Integer resizeType)Sets the ResizableTextureView.ResizeType final UnitsetTransformOptions(Integer anchorType, Float targetWidth, Float targetHeight, Float translateX, Float translateY)Sets the transform for textureView and thumbnailView. final UnitsetTransformOptions(TransformOption transformOption)Sets the transform for textureView and thumbnailView. final UnitsetMarginsInternally(Integer marginLeft, Integer marginTop, Integer marginRight, Integer marginBottom)Sets the margins for the texture view. final UnitsetSaveLastFrame(Boolean saveLastFrame)-
-
Constructor Detail
-
OutStreamVideoAdPlayback
OutStreamVideoAdPlayback(Context context, AttributeSet attrs, Integer defStyleAttr)
Constructs a new OutStreamVideoAdPlayback instance.
-
OutStreamVideoAdPlayback
OutStreamVideoAdPlayback(Context context, AttributeSet attrs)
Constructs a new OutStreamVideoAdPlayback instance.
-
OutStreamVideoAdPlayback
OutStreamVideoAdPlayback(Context context)
Constructs a new OutStreamVideoAdPlayback instance.
-
-
Method Detail
-
initialize
@JvmOverloads() final Unit initialize(VideoAdsRequest adsRequest, VideoProgressUpdate adProgress, BufferDurationsMs bufferDurationsMs, OutStreamVideoAdPlayback.BufferingOrThumbnailVisibleOption bufferingOrThumbnailVisibleOption, Integer dimmedColor, Boolean ended)
주어진 adsRequest와 adProgress를 기반으로 이 인스턴스를 초기화하고 videoPlayer를 준비합니다. 새로운 버퍼링 설정 API를 사용하여 더 세밀한 버퍼링 제어를 제공합니다.
- Parameters:
adsRequest- 비디오 광고 요청 객체adProgress- 현재 광고의 재생 진행 상태를 나타내는 VideoProgressUpdatebufferDurationsMs- 버퍼링 지속시간 설정 객체.bufferingOrThumbnailVisibleOption- 버퍼링 또는 썸네일 뷰의 표시 옵션dimmedColor- 비디오 또는 썸네일 위에 그려지는 dimmed 레이어의 색상 값.ended- 비디오 광고가 종료되었는지 여부
-
initialize
@JvmOverloads() final Unit initialize(VideoAdsRequest adsRequest, VideoProgressUpdate adProgress, BufferDurationsMs bufferDurationsMs, OutStreamVideoAdPlayback.BufferingOrThumbnailVisibleOption bufferingOrThumbnailVisibleOption, Integer dimmedColor)
주어진 adsRequest와 adProgress를 기반으로 이 인스턴스를 초기화하고 videoPlayer를 준비합니다. 새로운 버퍼링 설정 API를 사용하여 더 세밀한 버퍼링 제어를 제공합니다.
- Parameters:
adsRequest- 비디오 광고 요청 객체adProgress- 현재 광고의 재생 진행 상태를 나타내는 VideoProgressUpdatebufferDurationsMs- 버퍼링 지속시간 설정 객체.bufferingOrThumbnailVisibleOption- 버퍼링 또는 썸네일 뷰의 표시 옵션dimmedColor- 비디오 또는 썸네일 위에 그려지는 dimmed 레이어의 색상 값.
-
initialize
@JvmOverloads() final Unit initialize(VideoAdsRequest adsRequest, VideoProgressUpdate adProgress, BufferDurationsMs bufferDurationsMs, OutStreamVideoAdPlayback.BufferingOrThumbnailVisibleOption bufferingOrThumbnailVisibleOption)
주어진 adsRequest와 adProgress를 기반으로 이 인스턴스를 초기화하고 videoPlayer를 준비합니다. 새로운 버퍼링 설정 API를 사용하여 더 세밀한 버퍼링 제어를 제공합니다.
- Parameters:
adsRequest- 비디오 광고 요청 객체adProgress- 현재 광고의 재생 진행 상태를 나타내는 VideoProgressUpdatebufferDurationsMs- 버퍼링 지속시간 설정 객체.bufferingOrThumbnailVisibleOption- 버퍼링 또는 썸네일 뷰의 표시 옵션
-
initialize
@JvmOverloads() final Unit initialize(VideoAdsRequest adsRequest, VideoProgressUpdate adProgress, BufferDurationsMs bufferDurationsMs)
주어진 adsRequest와 adProgress를 기반으로 이 인스턴스를 초기화하고 videoPlayer를 준비합니다. 새로운 버퍼링 설정 API를 사용하여 더 세밀한 버퍼링 제어를 제공합니다.
- Parameters:
adsRequest- 비디오 광고 요청 객체adProgress- 현재 광고의 재생 진행 상태를 나타내는 VideoProgressUpdatebufferDurationsMs- 버퍼링 지속시간 설정 객체.
-
initialize
@JvmOverloads() final Unit initialize(VideoAdsRequest adsRequest, VideoProgressUpdate adProgress)
주어진 adsRequest와 adProgress를 기반으로 이 인스턴스를 초기화하고 videoPlayer를 준비합니다. 새로운 버퍼링 설정 API를 사용하여 더 세밀한 버퍼링 제어를 제공합니다.
- Parameters:
adsRequest- 비디오 광고 요청 객체adProgress- 현재 광고의 재생 진행 상태를 나타내는 VideoProgressUpdate
-
initialize
@JvmOverloads() final Unit initialize(VideoAdsRequest adsRequest)
주어진 adsRequest와 adProgress를 기반으로 이 인스턴스를 초기화하고 videoPlayer를 준비합니다. 새로운 버퍼링 설정 API를 사용하여 더 세밀한 버퍼링 제어를 제공합니다.
- Parameters:
adsRequest- 비디오 광고 요청 객체
-
initialize
@Deprecated(message = "이 메서드는 더 이상 사용되지 않습니다. BufferDurationsMs를 사용하는 새로운 initialize 메서드를 사용하세요.", replaceWith = @ReplaceWith(imports = {}, expression = "initialize(adsRequest, adProgress, BufferDurationsMs(backBufferDurationMillis = backBufferDurationMillis), bufferingOrThumbnailVisibleOption, dimmedColor, ended)")) final Unit initialize(VideoAdsRequest adsRequest, VideoProgressUpdate adProgress, Integer backBufferDurationMillis, OutStreamVideoAdPlayback.BufferingOrThumbnailVisibleOption bufferingOrThumbnailVisibleOption, Integer dimmedColor, Boolean ended)
주어진 adsRequest와 adProgress를 기반으로 이 인스턴스를 초기화하고 videoPlayer를 준비합니다.
- Parameters:
adsRequest- 비디오 광고 요청 객체adProgress- 현재 광고의 재생 진행 상태를 나타내는 VideoProgressUpdatebackBufferDurationMillis- 백 버퍼 지속시간 (밀리초)bufferingOrThumbnailVisibleOption- 버퍼링 또는 썸네일 뷰의 표시 옵션dimmedColor- 비디오 또는 썸네일 위에 그려지는 dimmed 레이어의 색상 값.ended- 비디오 광고가 종료되었는지 여부
-
destroy
final Unit destroy()
Destroys this OutStreamVideoAdPlayback.
Hides the overlay view and resets all state values.
-
seekTo
final Boolean seekTo(Long positionMillis)
Moves the ads to specified time position.
- Parameters:
positionMillis- the offset in milliseconds from the start to seek to.- Returns:
true if seek is possible; false otherwise.
-
stop
final Unit stop(VideoAdsManager adsManager)
Stops current playback.
- Parameters:
adsManager- the ads manager to stop current playback.
-
suspend
final Unit suspend(VideoAdsManager adsManager)
Suspends current playback.
For efficient memory management, save playback-related state values and release the player.
- Parameters:
adsManager- the ads manager to suspend current playback.
-
restore
@JvmOverloads() final Unit restore(VideoAdsManager adsManager, Boolean forcePlayWhenReady)
Restores the player based on the saved states and resume it.
- Parameters:
adsManager- the ads manager to restore playback.forcePlayWhenReady- a playWhenReady that can be forced to be used instead of using a stored playWhenReady value.
-
restore
@JvmOverloads() final Unit restore(VideoAdsManager adsManager)
Restores the player based on the saved states and resume it.
- Parameters:
adsManager- the ads manager to restore playback.
-
showOverlayView
final Unit showOverlayView()
Shows the overlay view.
Controlled by alpha value, not visibility.
-
hideOverlayView
final Unit hideOverlayView()
Hides the overlay view.
Controlled by alpha value, not visibility.
-
getAdDisplayContainer
@JvmOverloads() final VideoAdDisplayContainer getAdDisplayContainer(CompanionAdSlot companionAdSlot)
Creates and returns a VideoAdDisplayContainer with the given companionAdSlot.
-
getAdDisplayContainer
@JvmOverloads() final VideoAdDisplayContainer getAdDisplayContainer()
Creates and returns a VideoAdDisplayContainer with the given companionAdSlot.
-
getPlayWhenReady
final Boolean getPlayWhenReady()
Whether playback will proceed when playbackState is PlaybackState.PREPARED.
- Returns:
whether playback will proceed when ready.
-
getAdProgress
final VideoProgressUpdate getAdProgress()
Returns VideoProgressUpdate describing playback progress of the current ad or VideoProgressUpdate.NOT_READY if video details are not yet available.
-
isMuted
final Boolean isMuted()
Returns the mute state of the current audio stream.
trueto mute,falseto unmute.
-
isPlaying
final Boolean isPlaying()
Returns whether the player is playing.
- Returns:
whether the player is playing.
-
isEnded
final Boolean isEnded()
Whether the current ad has reached the end of the media or not.
- Returns:
whether the current ad has reached the end of the media or not.
-
getAudioFocusManager
final AudioFocusManager getAudioFocusManager()
-
setAspectRatio
final Unit setAspectRatio(Float aspectRatio)
Sets the new aspect ratio to the texture view.
-
setResizeType
final Unit setResizeType(Integer resizeType)
Sets the ResizableTextureView.ResizeType
-
setTransformOptions
final Unit setTransformOptions(Integer anchorType, Float targetWidth, Float targetHeight, Float translateX, Float translateY)
Sets the transform for textureView and thumbnailView. Don't forget to BufferingOrThumbnailVisibleOption.Visible.scaleType to ImageView.ScaleType.MATRIX to apply transform.
-
setTransformOptions
final Unit setTransformOptions(TransformOption transformOption)
Sets the transform for textureView and thumbnailView. Don't forget to BufferingOrThumbnailVisibleOption.Visible.scaleType to ImageView.ScaleType.MATRIX to apply transform.
-
setMarginsInternally
final Unit setMarginsInternally(Integer marginLeft, Integer marginTop, Integer marginRight, Integer marginBottom)
Sets the margins for the texture view.
-
setSaveLastFrame
final Unit setSaveLastFrame(Boolean saveLastFrame)
-
-
-
-