BaseVideoView

BaseVideoView provides the base functionality for BrightcoveVideoView, which for historical reasons isn't named BrightcoveSurfaceVideoView, and BrightcoveTextureVideoView. Those two classes are designed to be dropped into your XML layouts as a replacement for Android's native VideoView. This class provides public methods to mirror that of VideoView, plus additional logic for handling things like playlists. This class uses an EventEmitter to wire together components, like the VideoDisplayComponent and VideoPlaybackController.

See also

Inheritors

Constructors

Link copied to clipboard
constructor(context: Context)
constructor(context: Context, attributeSet: AttributeSet)
constructor(context: Context, attributeSet: AttributeSet, defStyle: Int)

Types

Link copied to clipboard
Interface definition for a callback to be invoked when the BaseVideoView's size changes.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open fun add(video: Video)
Adds the video to the end of the video list.
open fun add(index: Int, video: Video)
Adds the video to the video list at the specified index.
Link copied to clipboard
open fun addAll(newVideos: Collection<Video>)
Add all videos in the collection to the end of the list.
open fun addAll(index: Int, newVideos: Collection<Video>)
Inserts all videos in the collection at the specified index.
Link copied to clipboard
open fun addListener(eventType: String, listener: EventListener)
Link copied to clipboard
open fun addSubtitleSource(uri: Uri, format: BrightcoveCaptionFormat)
For adding subtitle sources to the Brightcove Player.
Link copied to clipboard
open fun canPause(): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun clear()
Removes all videos from the list.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Disable Generic Stream Concurrency
Link copied to clipboard
open fun dispatchKeyEvent(event: KeyEvent): Boolean
Link copied to clipboard
Enable Generic Stream Concurrency Note: Stream Concurrency can only be enable before video playback
Link copied to clipboard
This method finishes initializing the BaseVideoView.
Link copied to clipboard
open fun get(index: Int): Video
Link copied to clipboard
Returns the analytics component, the part of the player that monitors and tracks video playback and engagement.
Link copied to clipboard
Link copied to clipboard
Access the Brightcove media controller.
Link copied to clipboard
Link copied to clipboard
fun BaseVideoView.getCalculateSize(width: String?, height: String?): <Error class: unknown class><Int, Int>

getCalculateSize is an extension function that return the correct Sizes from an element taking the BaseVideoView width and height as 100%

Link copied to clipboard
open fun getCurrentIndex(): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getDuration(): Int
Link copied to clipboard
open fun getDurationLong(): Long
Link copied to clipboard
Getter for the EventEmitter used by this View
Link copied to clipboard
open fun getList(): List<Video>
Link copied to clipboard
Gets the rendered height of the video on the screen.
Link copied to clipboard
Gets the rendered width of the video on the screen.
Link copied to clipboard
open fun getMediaController(): MediaController
Access the legacy media controller.
Link copied to clipboard
Link copied to clipboard
Returns the video playback controller, the component of the player responsible for managing video playback and emitting cue points.
Link copied to clipboard
abstract fun getRenderView(): RenderView
Gets refers to the view that will render the video.
Link copied to clipboard
fun BaseVideoView.getScreenLayoutParams(top: String?, left: String?, width: Int? = 0, height: Int? = 0): <Error class: unknown class>?

getScreenLayoutParams is an extension function that get the position (top, left) as a percentage from the API and return the layout parameters taking the BaseVideoView width and height as 100% if it is an image or layout will also receive the width and height to add the sizes

Link copied to clipboard
fun BaseVideoView.getScreenSizes(): <Error class: unknown class><Int, Int>

getScreenSizes() extension function that returns a Pair of height and width to be used in getScreenLayoutParams() and getCalculateSize()

Link copied to clipboard
Returns the source controller, the component of the player that selects the source to play for a video.
Link copied to clipboard
open fun getStillView(): ImageView
Link copied to clipboard
Returns the video display, the low-level component responsible for decoding and rendering a video.
Link copied to clipboard
abstract fun getVideoHeight(): Int
Link copied to clipboard
Returns the video still display, the component of the player that shows and hides the still image if one is available for a video.
Link copied to clipboard
abstract fun getVideoWidth(): Int
Link copied to clipboard
open fun isFullScreen(): Boolean
Checks whether the application is currently in full-screen mode.
Link copied to clipboard
Link copied to clipboard
open fun isLandscape(): Boolean
Checks whether the device is currently in landscape orientation.
Link copied to clipboard
open fun isPlaying(): Boolean
Link copied to clipboard
Link copied to clipboard
Checks whether Generic Stream Concurrency is enabled or not
Link copied to clipboard

jumpTo is an extension function that emit the SEEK_TO event

Link copied to clipboard
open fun onControllerHide()
Link copied to clipboard
open fun onInterceptTouchEvent(ev: MotionEvent): Boolean
Link copied to clipboard
open fun onTouchEvent(motionEvent: MotionEvent): Boolean
Link copied to clipboard
open fun pause()
Pause playback
Link copied to clipboard
open fun remove(index: Int)
Removes the video at the specified index.
Link copied to clipboard
open fun removeListener(eventType: String)
Link copied to clipboard
open fun removeListeners()
Link copied to clipboard
open fun replace(index: Int, video: Video)
Removes and replaces the video at the specified index.
Link copied to clipboard
Request the current active sessions.
Link copied to clipboard
open fun requestLayout()
Link copied to clipboard
open fun seekTo(msec: Int)
open fun seekTo(msec: Long)
Seek to the time specified
Link copied to clipboard
open fun seekToLive()
Link copied to clipboard
Link copied to clipboard
open fun setCurrentIndex(index: Int)
Sets the current video to the specified index.
Link copied to clipboard
open fun setEventEmitter(eventEmitter: EventEmitter)
Sets the eventEmitter and instantiates all inner components.
Link copied to clipboard
open fun setLayoutParams(layoutParams: LayoutParams)
Link copied to clipboard
open fun setMediaController(mediaController: MediaController)
Establishes a legacy Android media controller to provide media controls.
Establishes the Brightcove media controller to provide a modern set of media controls.
Link copied to clipboard
open fun setOnCompletionListener(onCompletionListener: OnCompletionListener)
Link copied to clipboard
open fun setOnInfoListener(onInfoListener: OnInfoListener)
Link copied to clipboard
open fun setOnPreparedListener(onPreparedListener: OnPreparedListener)
Link copied to clipboard
Link copied to clipboard
Sets the headers values that will be passed on each request to the Generic Stream Concurrency.
Link copied to clipboard
Sets a listener to get the active sessions
Link copied to clipboard
open fun setSubtitleLocale(localeCode: String)
Sets the locale for a caption source to load, based on the caption locale pulled in.
Link copied to clipboard
Instantiates the Brightcove captioning view.
Link copied to clipboard
open fun setVideoPath(path: String): Video
Replaces player content with the video at the specified path.
open fun setVideoPath(videoPath: String, languageCodeCaptionsMap: Map<String, String>): Video
Replace player content with the video and captions at the specified paths.
Link copied to clipboard
open fun setVideoURI(uri: Uri): Video
Replaces player content with the video at the specified URI.
Link copied to clipboard
open fun start()
Start playback
Link copied to clipboard
open fun stopPlayback()
Stop playback
Link copied to clipboard
Toggles the BrightcoveMediaController's visibility when one is set.