TXPlayerVideo constructor

TXPlayerVideo({
  1. FTXOnRenderViewCreatedListener? onRenderViewCreatedListener,
  2. FTXAndroidRenderViewType? androidRenderType,
  3. Key? viewKey,
})

Starting from version 12.4.1, the method of binding textures by passing in a controller has been removed. This method is removed due to too many unforeseen issues. It is recommended to use the onRenderViewCreatedListener callback of TXPlayerVideo. After obtaining the viewId, use controller#setPlayerView to bind the player and texture.

e.g: TXPlayerVideo( onRenderViewCreatedListener: (viewId) { /// Only the most basic configuration methods for textures and the player are shown here. /// The viewId can be recorded here to switch between multiple textures. For example, in the scenario /// of switching between portrait and landscape orientations: /// To switch from the portrait view to the landscape view, obtain the viewId of the landscape view /// after switching to landscape orientation and set it. When switching back to portrait orientation, /// switch back using the recorded viewId. _controller.setPlayerView(viewId); }, )

Implementation

TXPlayerVideo({
  this.onRenderViewCreatedListener,
  FTXAndroidRenderViewType? androidRenderType, Key? viewKey})
    : renderViewType = androidRenderType ?? FTXAndroidRenderViewType.TEXTURE_VIEW, super(key: viewKey);