SuperPlayerViewComponent as the video rendering container:import { SuperPlayerViewComponent } from 'react-native-superplayer';import { View, StyleSheet, Dimensions } from 'react-native';const { width: SCREEN_WIDTH } = Dimensions.get('window');const VIDEO_HEIGHT = (SCREEN_WIDTH * 9) / 16; // 16:9function PlayerScreen() {const handleViewReady = (viewId: string) => {console.log('playerView ready', viewId);// create player and bind view};return (<View style={styles.container}><SuperPlayerViewComponentviewId="my_player_view"style={styles.player}onReady={handleViewReady}/></View>);}const styles = StyleSheet.create({container: {flex: 1,},player: {width: SCREEN_WIDTH,height: VIDEO_HEIGHT,backgroundColor: '#000',},});
onReady callback, create an instance of TXVodPlayer and bind it to the view:import { TXVodPlayer, TXVodConstants } from 'react-native-superplayer';import { useRef, useCallback } from 'react';function PlayerScreen() {const playerRef = useRef<TXVodPlayer | null>(null);const handleViewReady = useCallback((viewId: string) => {// create playerconst player = new TXVodPlayer();// Bind a viewplayer.setPlayerView(viewId);// Set up event listeningplayer.setListener({onPlayEvent: (event, param) => {switch (event) {case TXVodConstants.VOD_PLAY_EVT_PLAY_BEGIN:console.log('play start');break;case TXVodConstants.VOD_PLAY_EVT_PLAY_END:console.log('play end');break;// other event...}},});playerRef.current = player;}, []);// ... other code}
startPlay function.// play URLplayer.startPlay('https://example.com/video.mp4');
// psign is the player signatureplayer.startPlayWithFileId(1500005830, // appId'387702307091793695', // fileId'your_psign' // sign);
VOD_PLAY_ERR_GET_PLAYINFO_FAIL event. Conversely, receiving VOD_PLAY_EVT_VOD_PLAY_PREPARED indicates a successful request.import { useEffect } from 'react';function PlayerScreen() {const playerRef = useRef<TXVodPlayer | null>(null);useEffect(() => {return () => {// destroy playerif (playerRef.current) {playerRef.current.destroy();playerRef.current = null;}};}, []);// ... other code}
startPlay, to avoid potential memory leaks and screen flickering issues.// stop playplayer.stop(true);
player.pause();
player.resume();
player.stop(true);
// Jump to a specified time point (in seconds)// The second parameter, accurateSeek: true = precise seek (more time-consuming), false = quick seekplayer.seek(30, true); // Accurately skip to 30 seconds.player.seek(60, false); // Accurately skip to 60 seconds.
startPlay, playback from a specified time is supported.// Set the start playback time (must be called before startPlay)player.setStartTime(10); // Start playback from the 10th secondplayer.startPlay(url);
setRate interface. It allows for both fast and slow playback, such as 0.5X, 1.0X, 1.2X, 2X, and more.// Set playback speed to 1.2xplayer.setRate(1.2);
// Configure loop playback settingsplayer.setLoop(true);// Retrieve the current loop playback statusconst isLooping = player.isLoop();
// Set mute, true to enable mute, false to disable muteplayer.setMute(true);// Set volume (0-100)player.setVolume(50);
player.stop(true);player.enableHardwareDecode(true);player.startPlay(url);
// The value will only be returned when getSupportedBitrates is called after receiving the player VOD_PLAY_EVT_VOD_PLAY_PREPARED event.const bitrateList = player.getSupportedBitrates();// Return BitrateItem[]// [{ index: 0, width: 1920, height: 1080, bitrate: 2000000 }, ...]const index = bitrateList[0].index; // Specify the bitrate index to be played.player.setBitrateIndex(index); // Switch the bitrate to the desired resolution.// Retrieve the current resolution index.const currentIndex = player.getBitrateIndex();
// Limit the maximum bitrate for adaptive playback (unit: Kbps)player.setAutoMaxBitrate(2000);
player.setBitrateIndex(-1); // Pass -1 as the index parameter
const config: TXVodPlayConfig = {smoothSwitchBitrate: true,};player.setConfig(config);
setListener interface. Progress notifications will be delivered to your application through the VOD_PLAY_EVT_PLAY_PROGRESS event callback.player.setListener({onPlayEvent: (event, param) => {if (event === TXVodConstants.VOD_PLAY_EVT_PLAY_PROGRESS) {// Current playback progress (in milliseconds)const currentMs = param[TXVodConstants.EVT_PLAY_PROGRESS_MS] ?? 0;// Total video duration (in milliseconds)const durationMs = param[TXVodConstants.EVT_PLAY_DURATION_MS] ?? 0;// Playable duration (in milliseconds), i.e., loading progressconst playableMs = param[TXVodConstants.EVT_PLAYABLE_DURATION_MS] ?? 0;console.log(`progress: ${currentMs / 1000}s / ${durationMs / 1000}s`);}},});
onNetStatus callback of the setListener interface.player.setListener({onNetStatus: (param) => {const speed = param.NET_SPEED; // Network Speed (kbps)const vBitrate = param.VIDEO_BITRATE; // Video Bitrateconst aBitrate = param.AUDIO_BITRATE; // Audio Bitrateconst fps = param.VIDEO_FPS; // Frame Rate},// ...});
VIDEO_WIDTH and VIDEO_HEIGHT in onNetStatus.VOD_PLAY_EVT_VOD_PLAY_PREPARED event callback from the player, directly call getWidth() and getHeight() to obtain the current width and height.player.setListener({onNetStatus: (param) => {const w = param.VIDEO_WIDTH;const h = param.VIDEO_HEIGHT;},// ...});// To obtain the video width and height, the return value is only available after receiving the VOD_PLAY_EVT_VOD_PLAY_PREPARED event callback from the player.const width = player.getWidth();const height = player.getHeight();
// Current playback time (seconds)const currentTime = player.getCurrentPlaybackTime();// Total video duration (seconds)const duration = player.getDuration();// Playable duration (seconds, buffered portion)const playableDuration = player.getPlayableDuration();// Buffering duration (seconds)const bufferDuration = player.getBufferDuration();// Video widthconst width = player.getWidth();// Video Heightconst height = player.getHeight();// Is currently playingconst isPlaying = player.isPlaying();
const config: TXVodPlayConfig = {maxBufferSize: 10, // Maximum buffer size during playback. Unit: MB};player.setConfig(config);
import { RNTXPlayerGlobalSetting } from 'react-native-superplayer';// Set the global cache directory for the playback engineRNTXPlayerGlobalSetting.setCacheFolderPath('txcache');// Set the maximum cache size (MB)RNTXPlayerGlobalSetting.setMaxCacheSize(200);
// Capture the current frame, return the local image pathconst imagePath = await player.snapshot();console.log('Screenshot saved to:', imagePath);// Can also be obtained via callbackplayer.setListener({onSnapshot: (path) => {console.log('Screenshot path:', path);},// ...});
import { TXVodConstants } from 'react-native-superplayer';// Full-fill mode (crops the picture, no black bars)player.setRenderMode(TXVodConstants.RENDER_MODE_FULL_FILL_SCREEN);// Adjust mode (scales proportionally, may have black bars)player.setRenderMode(TXVodConstants.RENDER_MODE_ADJUST_RESOLUTION);
// Set the screen rotation angle (0, 90, 180, 270)player.setRenderRotation(90);
// Enable/disable mirroringplayer.setMirror(true);
startPlay, and call selectTrack to select the subtitle after receiving the VOD_PLAY_EVT_VOD_PLAY_PREPARED event. The subtitle text content will be delivered via the onSubtitleData event callback; rendering the subtitles on screen must be handled by your own application.import { SubtitleMimeType } from 'react-native-superplayer';// [Important] Must be called before startPlayplayer.addSubtitleSource('https://example.com/subtitle_cn.srt', // Subtitle URL'Chinese', // Subtitle name (must be unique across multiple subtitles)SubtitleMimeType.SRT // Subtitle format: 0=SRT, 1=VTT);player.addSubtitleSource('https://example.com/subtitle_en.vtt','English',SubtitleMimeType.VTT);// Then start playbackplayer.startPlay(videoUrl);
// [Important] Must set extInfoMap['450'] = 0 to receive the onSubtitleData callbackplayer.setConfig({extInfoMap: {'450': 0, // Enable subtitle text callback},});player.setListener({onSubtitleData: (data) => {// data.subtitleData: subtitle text (empty string means clear screen)// data.trackIndex: current subtitle track indexconsole.log('Subtitle:', data.subtitleData);},// ...});
// Get the subtitle track listconst subtitleTracks = player.getSubtitleTrackInfo();// Select the specified subtitle trackplayer.selectTrack(subtitleTracks[0].trackIndex);// Deselect (turn off subtitles)player.deselectTrack(subtitleTracks[0].trackIndex);
// Get the audio track listconst audioTracks = player.getAudioTrackInfo();// Switch audio trackplayer.selectTrack(audioTracks[1].trackIndex);// TXTrackInfo structureinterface TXTrackInfo {trackIndex: number; // Track indextrackType: number; // Track type: 1=video, 2=audio, 3=subtitlename: string; // Track nameisSelected: boolean; // Whether selectedisExclusive: boolean; // Whether mutually exclusiveisInternal: boolean; // Whether embedded (false = external)}
TXVodPlayer.bundle, which must be manually added to the Xcode project before compiling. Do not change the bundle name or any resource name inside it, otherwise seamless switching to Picture-in-Picture will fail.

setAutoPictureInPictureEnabled(true) for auto PiP does the user need to enable this in advance in system settings:
SYSTEM_ALERT_WINDOW permission is declared in the AndroidManifest.xml of the App containing the player (already declared by the SDK itself; no additional configuration is needed after including the SDK).import { TXVodPlayer } from 'react-native-superplayer';const code = TXVodPlayer.isDeviceSupportPip();// Return value:// 0 = Supported (Android includes granted permission)// -101 = Android has no overlay window permission// -201 = iOS device or system version not supported// Other = platform-specific error code, see the error code table for details
// Navigate to the system authorization page, letting the user manually enable the overlay window permissionTXVodPlayer.requestOverlayPermission();
// Enter Picture-in-Pictureplayer.enterPictureInPictureMode();// Exit Picture-in-Pictureplayer.exitPictureInPictureMode();
import { Platform } from 'react-native';import { TXVodPlayer } from 'react-native-superplayer';const handleEnterPip = () => {const player = playerRef.current;if (!player) return;if (Platform.OS === 'android') {const code = TXVodPlayer.isDeviceSupportPip();if (code !== 0) {TXVodPlayer.requestOverlayPermission();return;}}player.enterPictureInPictureMode();};
// After enabling:// - iOS: just call it; the system automatically enters PiP when the App goes to the background// - Android: the SDK does not listen to the App lifecycle; the business side needs to use AppState to listen on its ownplayer.setAutoPictureInPictureEnabled(true);
import { useEffect } from 'react';import { AppState, Platform } from 'react-native';useEffect(() => {if (Platform.OS !== 'android' || !autoPipEnabled) return;const sub = AppState.addEventListener('change', (next) => {const player = playerRef.current;if (!player) return;if (next === 'background' && player.isPlaying()) {player.enterPictureInPictureMode();} else if (next === 'active') {player.exitPictureInPictureMode();}});return () => sub.remove();}, [autoPipEnabled]);
import type { TXPipListener } from 'react-native-superplayer';player.setPipListener({onPipStart: () => {console.log('Picture-in-Picture started');},onPipStop: () => {console.log('Picture-in-Picture stopped');},onPipRestore: () => {// User tapped the restore button inside the overlay windowconsole.log('User tapped the restore button');},onPipError: (code, message) => {console.warn(`Picture-in-Picture error code=${code} msg=${message ?? ''}`);},});// Remove the listenerplayer.setPipListener(null);
Range | Platform |
0 | General, no error. |
-1xx | Android-specific (overlay window implementation). |
-2xx | iOS-specific (system PiP implementation). |
Error Code | Meaning | SDK Behavior | Business Recommendation |
-101 | Missing overlay window permission. | Automatically navigates to the system authorization page. | Guide the user to grant the permission, then call enterPictureInPictureMode() again after returning. |
-102 | Cannot find the player instance corresponding to the playerId. | Returns directly. | Check whether the player was destroyed too early. |
-103 | WindowManager.addView failed. | Automatically cleans up resources. | Report the log + prompt the user to retry. |
Error Code | Meaning | Trigger Scenario |
-201 | Device or system version does not support PiP. | Used for synchronous pre-check by isDeviceSupportPip(). |
-206 | Cannot find the player instance corresponding to the playerId. | RN-layer validation, triggered when the business destroys the player too early. |
-200 | PiP error from the SDK (unified code). | All errors thrown by AVPictureInPictureController; the specific error type is passed through via message. |
import {RNTXPlayerGlobalSetting,TXVodPreloadManager,type TXPlayInfoParams,} from 'react-native-superplayer';// [Important] The cache directory and size must be set first; a global setting is only needed onceRNTXPlayerGlobalSetting.setCacheFolderPath('txcache');RNTXPlayerGlobalSetting.setMaxCacheSize(500); // 500MB// Add callback listenerconst removeComplete = TXVodPreloadManager.addCompleteListener((event) => {console.log('Preload complete:', event.taskId, event.url);});const removeError = TXVodPreloadManager.addErrorListener((event) => {console.error('Preload failed:', event.code, event.message);});// Start preloadingconst params: TXPlayInfoParams = {url: 'https://example.com/video.mp4',};const taskId = await TXVodPreloadManager.startPreload(params, // Preload parameters10, // Preload size (MB)921600 // Expected resolution (1280×720 = 921600); pass -1 if not specified);// Stop preloadingTXVodPreloadManager.stopPreload(taskId);// Remove the listeners when no longer neededremoveComplete();removeError();
const removeStart = TXVodPreloadManager.addStartListener((event) => {console.log('Preload started:', event.taskId);console.log('Actual playback URL:', event.url); // URL after FileId link resolution});const params: TXPlayInfoParams = {appId: 1500005830,fileId: '387702307091793695',pSign: 'your_psign',};const taskId = await TXVodPreloadManager.startPreload(params, 10, 921600);
TXVodDownloadManager.import {RNTXPlayerGlobalSetting,TXVodDownloadManager,} from 'react-native-superplayer';// Set the download directory; a global setting is only needed onceRNTXPlayerGlobalSetting.setCacheFolderPath('txcache');
const TXVodQuality = {'240P': 240,'360P': 360,'480P': 480,'540P': 540,'720P': 720,'1080P': 1080,};const mediaInfo = await TXVodDownloadManager.startDownload({appId: 1500005830,fileId: '387702307091793695',quality: TXVodQuality['720P'], // Download resolutionpSign: 'your_psign',userName: 'default',});
const mediaInfo = await TXVodDownloadManager.startDownloadUrl('https://example.com/video.mp4',921600, // Expected resolution'default' // User identifier);
// Add progress listenerconst removeProgress = TXVodDownloadManager.addProgressListener((event) => {const { progress, speed } = event.mediaInfo;console.log(`Download progress: ${(progress * 100).toFixed(1)}%, speed: ${speed}KB/s`);});// Add completion listenerconst removeFinish = TXVodDownloadManager.addFinishListener((event) => {console.log('Download complete:', event.mediaInfo.playPath);// Use playPath to play the offline videoplayer.startPlay(event.mediaInfo.playPath);});// Add error listenerconst removeError = TXVodDownloadManager.addErrorListener((event) => {console.error('Download error:', event.errorCode, event.errorMsg);});
Event | Description |
DownloadState.START | Task started, indicating the SDK has begun downloading. |
DownloadState.FINISH | Download complete; receiving this callback indicates the entire file has been downloaded. The downloaded file can now be played by TXVodPlayer. |
DownloadState.STOP | Task stopped; when you call stopDownload to stop the download, receiving this message indicates the stop was successful. |
DownloadState.ERROR | Download error; this callback is triggered if the network disconnects during the download, and the download task stops at the same time. |
stopDownload() method with the mediaInfo object returned when the download was started as the parameter. The SDK supports resumable downloads: as long as the download directory has not changed, the next time you download the same file it will resume from where it last stopped.TXVodDownloadManager.stopDownload(mediaInfo);
// Get all download tasksconst list = await TXVodDownloadManager.getDownloadMediaInfoList();// Get download info by URLconst info = await TXVodDownloadManager.getDownloadMediaInfo(url);// Delete the download (including the local file)const success = TXVodDownloadManager.deleteDownloadMediaInfo(mediaInfo);
DownloadState.FINISH, and the playPath of the mediaInfo has a value, this indicates that the video caching is complete and it can be passed directly to the player for playback:const cacheVideoUrl = cacheMediaInfo.playPath;player.startPlay(cacheVideoUrl);
// psign is the player signatureplayer.startPlayWithFileId(1500005830, // appId'387702307091793695', // fileId'your_psign' // Playback signature);
import { TXVodConstants } from 'react-native-superplayer';// Set the HEVC fallback configurationplayer.setExtendedOption({// Specify the original video encoding type as HEVC[TXVodConstants.VOD_KEY_VIDEO_CODEC_TYPE]: TXVodConstants.VIDEO_CODEC_HEVC,// Set the fallback playback link in H.264 format[TXVodConstants.VOD_KEY_BACKUP_URL]: 'https://example.com/video_h264.mp4',// Optional: set the media type of the fallback resource[TXVodConstants.VOD_KEY_BACKUP_URL_MEDIA_TYPE]: TXVodConstants.MEDIA_TYPE_AUTO,});// Play the HEVC video; if not supported, the SDK will automatically fall back to the backup URLplayer.startPlay('https://example.com/video_hevc.mp4');
startPlay, you can configure the player's parameters via setConfig, such as setting the connection timeout, the progress callback interval, the number of cache files, and so on.import type { TXVodPlayConfig } from 'react-native-superplayer';const config: TXVodPlayConfig = {// Network configurationconnectRetryCount: 3, // Number of reconnection retriesconnectRetryInterval: 3, // Reconnection interval (seconds)timeout: 10, // Connection timeout (seconds)// Seek configurationenableAccurateSeek: true, // Enable accurate seek// Progress callbackprogressInterval: 500, // Progress callback interval (milliseconds)// Buffering configurationmaxBufferSize: 50, // Maximum playback buffer (MB)maxPreloadSize: 10, // Preload buffer (MB)// Resolution configurationpreferredResolution: 921600, // Preferred resolution for HLS startup playback (1280×720)// Subtitle callbackextInfoMap: {'450': 0, // Enable subtitle text callback},// Custom HTTP Headerheaders: {'User-Agent': 'MyApp/1.0',},};player.setConfig(config);
Parameter | Type | Default | Description |
connectRetryCount | number | 3 | Number of reconnection retries. |
connectRetryInterval | number | 3 | Reconnection interval (seconds, range 3-30). |
timeout | number | 10 | Connection timeout (seconds). |
enableAccurateSeek | boolean | true | Whether to enable accurate seek. |
autoRotate | boolean | true | Whether MP4 auto-rotates. |
smoothSwitchBitrate | boolean | false | Whether to smoothly switch bitrate. |
progressInterval | number | 500 | Progress callback interval (milliseconds). |
maxBufferSize | number | - | Maximum playback buffer (MB). |
maxPreloadSize | number | - | Preload buffer (MB). |
preferredResolution | number | - | Preferred resolution for HLS startup playback. |
headers | object | - | Custom HTTP Header. |
preferredAudioTrack | string | - | Preferred audio track name at startup. |
playerType | number | 1 | Player type (0: system player; 1: self-developed player). |
mediaType | number | 0 | Media type (0: automatic). |
extInfoMap | object | - | Extended configuration. |
setBitrateIndex.const config: TXVodPlayConfig = {// The parameter passed in is the product of the video width and height (width × height); you can pass in a custom valuepreferredResolution: 720 * 1280,};player.setConfig(config);
mediaType to reduce internal playback type detection by the Player SDK, thereby improving startup speed.const config: TXVodPlayConfig = {mediaType: TXVodConstants.MEDIA_TYPE_FILE_VOD, // Used to improve MP4 startup speed// ormediaType: TXVodConstants.MEDIA_TYPE_HLS_VOD, // Used to improve HLS startup speed};player.setConfig(config);
import { RNTXPlayerGlobalSetting } from 'react-native-superplayer';// Set the cache directory (use a relative path)// Android: sdcard/Android/data/{package name}/files/txcache// iOS: Documents/txcacheRNTXPlayerGlobalSetting.setCacheFolderPath('txcache');// Set the maximum cache size (MB)RNTXPlayerGlobalSetting.setMaxCacheSize(500);// Get the current cache directoryconst cachePath = RNTXPlayerGlobalSetting.getCacheFolderPath();// Get the current maximum cache sizeconst maxSize = RNTXPlayerGlobalSetting.getMaxCacheSize();// Enable flexible License validation (used when there isn't enough time to validate on first startup)RNTXPlayerGlobalSetting.setLicenseFlexibleValid(true);
setListener of TXVodPlayer to listen to the player's playback events and synchronize information to your application.Event ID | Value | Description |
VOD_PLAY_EVT_PLAY_BEGIN | 2004 | Video playback started. |
VOD_PLAY_EVT_PLAY_PROGRESS | 2005 | Video playback progress; notifies the current playback progress, loading progress, and total duration. |
VOD_PLAY_EVT_PLAY_LOADING | 2007 | Video playback loading; if it can recover, a VOD_PLAY_EVT_VOD_LOADING_END event will follow. |
VOD_PLAY_EVT_VOD_LOADING_END | 2014 | Video playback loading ended; video playback continues. |
VOD_PLAY_EVT_SEEK_COMPLETE | 2019 | Seek complete. |
Event ID | Value | Description |
VOD_PLAY_EVT_PLAY_END | 2006 | Video playback ended. |
VOD_PLAY_ERR_NET_DISCONNECT | -2301 | Network disconnected, and could not recover after multiple reconnection attempts; for further retries, please restart playback yourself. |
VOD_PLAY_ERR_FILE_NOT_FOUND | -2303 | File does not exist. |
VOD_PLAY_ERR_HLS_KEY | -2305 | Failed to obtain the HLS decryption key. |
Event ID | Value | Description |
VOD_PLAY_ERR_HEVC_DECODE_FAIL | -2304 | H.265 decoding failed. |
VOD_PLAY_ERR_GET_PLAYINFO_FAIL | -2306 | Failed to obtain VOD playback information. |
VOD_PLAY_ERR_INVALID_LICENCE | -5 | Invalid License. |
Event ID | Value | Description |
VOD_PLAY_EVT_VOD_PLAY_PREPARED | 2013 | The player is ready and can start playback. After setting autoPlay to false, you need to call resume after receiving this event for playback to begin. |
VOD_PLAY_EVT_RCV_FIRST_I_FRAME | 2003 | The network received the first renderable video packet (IDR). |
VOD_PLAY_EVT_HIT_CACHE | 2002 | Hit the local cache. |
Event ID | Value | Description |
VOD_PLAY_EVT_CHANGE_RESOLUTION | 2009 | Video resolution changed. |
Event ID | Value | Description |
VOD_PLAY_EVT_SELECT_TRACK_COMPLETE | 2020 | Track switching complete. |
VOD_PLAY_EVT_LOOP_ONCE_COMPLETE | 6001 | One loop of playback has ended. |
setListener:player.setListener({onPlayEvent: (event, param) => {switch (event) {case TXVodConstants.VOD_PLAY_EVT_VOD_PLAY_PREPARED:console.log('Preparation complete');break;case TXVodConstants.VOD_PLAY_EVT_PLAY_BEGIN:console.log('Playback started');break;case TXVodConstants.VOD_PLAY_EVT_PLAY_PROGRESS:const current = param[TXVodConstants.EVT_PLAY_PROGRESS_MS] / 1000;const duration = param[TXVodConstants.EVT_PLAY_DURATION_MS] / 1000;console.log(`Progress: ${current}s / ${duration}s`);break;case TXVodConstants.VOD_PLAY_EVT_PLAY_END:console.log('Playback ended');break;case TXVodConstants.VOD_PLAY_EVT_CHANGE_RESOLUTION:const width = param[TXVodConstants.EVT_PARAM1];const height = param[TXVodConstants.EVT_PARAM2];console.log(`Resolution changed: ${width}x${height}`);break;default:if (event < 0) {const msg = param[TXVodConstants.EVT_DESCRIPTION];console.error(`Playback error [${event}]: ${msg}`);}}},});
Metric | Description |
NET_SPEED | Current network data receiving speed, in Kbps. |
VIDEO_FPS | Current frame rate of the streaming video. |
VIDEO_BITRATE | Current video bitrate of the streaming media, in Kbps. |
AUDIO_BITRATE | Current audio bitrate of the streaming media, in Kbps. |
VIDEO_CACHE | Buffer (jitter buffer) size; if the current buffer length is 0, it indicates that stuttering is imminent. |
VIDEO_WIDTH | Video resolution - width. |
VIDEO_HEIGHT | Video resolution - height. |
onNetStatus:player.setListener({onNetStatus: (param) => {const speed = param.NET_SPEED;const videoWidth = param.VIDEO_WIDTH;const videoHeight = param.VIDEO_HEIGHT;},// ...});
player.setListener({onSubtitleData: (data) => {// data.subtitleData: subtitle text (empty string means clear screen)// data.trackIndex: subtitle track indexif (data.subtitleData) {setSubtitleText(data.subtitleData);} else {setSubtitleText(''); // Clear screen}},// ...});
フィードバック