AliyunPlayer v7.11.0
Aliyun Player API Reference Manual for iOS Platforms
Loading...
Searching...
No Matches
AliVttSubtitleView Class Reference

VTT subtitle view main class. More...

#include "AliVttSubtitleView.h"

Inheritance diagram for AliVttSubtitleView:
<AliVttSubtitleViewProtocol>

Instance Methods

(void) - destroy
 Destroy subtitle view and clean up all resources.
 
(nullable AliWebVttHeader *) - getVttHeader:
 Get VTT header information for specified track.
 
(void) - hide:trackIndex:subtitleID:
 Hide subtitle.
 
(instancetype) - init
 Initialize subtitle view.
 
(void) - setRenderImplFactory:
 Set custom rendering implementation factory.
 
(void) - setVttHeader:trackIndex:Header:
 Set VTT header information.
 
(void) - show:trackIndex:subtitleID:subtitle:
 Show subtitle.
 
- Instance Methods inherited from <AliVttSubtitleViewProtocol>
(void) - clearAll
 
(void) - setView:
 

Class Methods

(void) + setConstClass:
 Set global constant class.
 

Properties

BOOL isEnableSubtitleRender
 是否启用字幕渲染 Whether subtitle rendering is enabled
 
AliVttRenderImplFactoryBlock renderFactory
 客户自定义渲染实现工厂 Client custom rendering implementation factory
 
NSMutableDictionary< NSNumber *, AliVttRender * > * renderMap
 轨道索引到渲染器的映射表 Mapping table from track index to renderer
 

Detailed Description

VTT subtitle view main class.

Entry class for subtitle system, managing multi-track subtitle rendering. Implements AliVttSubtitleViewProtocol for player integration.

// Basic usage example
AliVttSubtitleView *subtitleView = [[AliVttSubtitleView alloc] init];
[player setExternalSubtitleView:subtitleView];
// Custom rendering implementation
[subtitleView setRenderImplFactory:^AliVttRenderImpl*() {
return [[CustomVttRenderImpl alloc] init];
}];
// Custom constant configuration
[AliVttSubtitleView setConstClass:[MySubtitleConst class]];
VTT subtitle rendering implementation class.
Definition AliVttSubtitleView.h:404
VTT subtitle view main class.
Definition AliVttSubtitleView.h:900
instancetype init()
Initialize subtitle view.

Method Documentation

◆ destroy

- (void) destroy

Destroy subtitle view and clean up all resources.

◆ getVttHeader:

- (nullable AliWebVttHeader *) getVttHeader: (int) trackIndex

Get VTT header information for specified track.

Parameters
trackIndexTrack index
Returns
WebVttHeader object, returns nil if not found or not initialized
Note
This method returns parsed WebVTT header information, including style and region definitions

◆ hide:trackIndex:subtitleID:

- (void) hide: (AliPlayer *) player
trackIndex: (int) trackIndex
subtitleID: (long) subtitleID 

Hide subtitle.

Parameters
playerPlayer object
trackIndexTrack index
subtitleIDSubtitle ID

◆ init

- (instancetype) init

Initialize subtitle view.

Returns
Initialized subtitle view instance

◆ setConstClass:

+ (void) setConstClass: (Class) constClass

Set global constant class.

Parameters
constClassClass object of constant class
Note
Static method that affects default configuration of all instances

◆ setRenderImplFactory:

- (void) setRenderImplFactory: (AliVttRenderImplFactoryBlock) factory

Set custom rendering implementation factory.

Parameters
factoryRendering implementation factory block
Note
Allows clients to provide custom rendering logic

◆ setVttHeader:trackIndex:Header:

- (void) setVttHeader: (AliPlayer *) player
trackIndex: (int) trackIndex
Header: (NSString *) header 

Set VTT header information.

Parameters
playerPlayer object
trackIndexTrack index
headerVTT header string

◆ show:trackIndex:subtitleID:subtitle:

- (void) show: (AliPlayer *) player
trackIndex: (int) trackIndex
subtitleID: (long) subtitleID
subtitle: (NSString *) subtitle 

Show subtitle.

Parameters
playerPlayer object
trackIndexTrack index
subtitleIDSubtitle ID
subtitleSubtitle content

Property Documentation

◆ isEnableSubtitleRender

- (BOOL) isEnableSubtitleRender
readwriteatomicassign

是否启用字幕渲染 Whether subtitle rendering is enabled

◆ renderFactory

- (AliVttRenderImplFactoryBlock) renderFactory
readwritenonatomiccopy

客户自定义渲染实现工厂 Client custom rendering implementation factory

◆ renderMap

- (NSMutableDictionary<NSNumber *, AliVttRender *>*) renderMap
readwritenonatomicstrong

轨道索引到渲染器的映射表 Mapping table from track index to renderer


The documentation for this class was generated from the following file: