提交 86042c9a authored 作者: kongdywang's avatar kongdywang

update to 12.8.1 & Enhance rendering compatibility & player widget's delegate not required now

(cherry picked from commit 89c907eea1f9aceaf7c4df83c78d9605dd65fc27)
上级 78c06073
#### Version: 12.8.1 2025.10.23
##### Features:
- Enhance rendering compatibility.
#### Version: 12.8.0 2025.09.19 #### Version: 12.8.0 2025.09.19
##### Features: ##### Features:
......
...@@ -5,7 +5,7 @@ buildLog() { ...@@ -5,7 +5,7 @@ buildLog() {
} }
inputVersion=$1 inputVersion=$1
export VERSION_NAME="12.8.0" export VERSION_NAME="12.8.1"
if [ -n "$inputVersion" ]; then if [ -n "$inputVersion" ]; then
VERSION_NAME=$inputVersion VERSION_NAME=$inputVersion
fi fi
......
...@@ -4,7 +4,7 @@ rootProject.ext { ...@@ -4,7 +4,7 @@ rootProject.ext {
supportSdkVersion = "26.0.1" supportSdkVersion = "26.0.1"
minSdkVersion = 19 minSdkVersion = 19
targetSdkVersion = 28 targetSdkVersion = 28
playerVersion = "12.8.0" playerVersion = "12.8.1"
compat = "androidx.appcompat:appcompat:1.6.1" compat = "androidx.appcompat:appcompat:1.6.1"
/** /**
......
...@@ -6,7 +6,6 @@ import android.opengl.EGLConfig; ...@@ -6,7 +6,6 @@ import android.opengl.EGLConfig;
import android.opengl.EGLContext; import android.opengl.EGLContext;
import android.opengl.EGLDisplay; import android.opengl.EGLDisplay;
import android.opengl.EGLSurface; import android.opengl.EGLSurface;
import android.opengl.GLES30;
import android.os.Handler; import android.os.Handler;
import android.os.HandlerThread; import android.os.HandlerThread;
import android.view.Surface; import android.view.Surface;
...@@ -29,11 +28,12 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener { ...@@ -29,11 +28,12 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
private SurfaceTexture mSurfaceTexture; private SurfaceTexture mSurfaceTexture;
private FTXTextureRender mTextureRender; private FTXTextureRender mTextureRender;
private Surface mInputSurface; private Surface mInputSurface;
private Surface mOutPutSurface;
private EGLDisplay mEGLDisplay = EGL14.EGL_NO_DISPLAY; private EGLDisplay mEGLDisplay = EGL14.EGL_NO_DISPLAY;
private EGLContext mEGLContext = EGL14.EGL_NO_CONTEXT; private final EGLContext mEGLContext = EGL14.EGL_NO_CONTEXT;
private EGLContext mEGLContextEncoder = EGL14.EGL_NO_CONTEXT; private EGLContext mEGLContextEncoder = EGL14.EGL_NO_CONTEXT;
private EGLSurface mEGLSurface = EGL14.EGL_NO_SURFACE; private final EGLSurface mEGLSurface = EGL14.EGL_NO_SURFACE;
private EGLSurface mEGLSurfaceEncoder = EGL14.EGL_NO_SURFACE; private EGLSurface mEGLSurfaceEncoder = EGL14.EGL_NO_SURFACE;
private EGLContext mEGLSavedContext = EGL14.EGL_NO_CONTEXT; private EGLContext mEGLSavedContext = EGL14.EGL_NO_CONTEXT;
...@@ -98,12 +98,14 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener { ...@@ -98,12 +98,14 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
private synchronized void startDrawSurface() { private synchronized void startDrawSurface() {
try { try {
if (!mStart) { if (!mStart) {
LiteavLog.e(TAG, "end....... "); LiteavLog.e(TAG, "draw thread is dead");
return; return;
} }
saveCurrentEglEnvironment(); saveCurrentEglEnvironment();
if (!makeCurrent(1)) { if (!makeCurrent(1)) {
LiteavLog.e(TAG, "makeCurrent error"); return;
}
if (!mOutPutSurface.isValid()) {
return; return;
} }
...@@ -137,7 +139,6 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener { ...@@ -137,7 +139,6 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
} }
if (!makeCurrent(1)) { if (!makeCurrent(1)) {
LiteavLog.e(TAG, "makeCurrent error");
bRet = false; bRet = false;
break; break;
} }
...@@ -211,30 +212,23 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener { ...@@ -211,30 +212,23 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
private boolean eglSetup(Surface surface) { private boolean eglSetup(Surface surface) {
mEGLDisplay = EGL14.eglGetDisplay(EGL14.EGL_DEFAULT_DISPLAY); mEGLDisplay = EGL14.eglGetDisplay(EGL14.EGL_DEFAULT_DISPLAY);
if (mEGLDisplay == EGL14.EGL_NO_DISPLAY) { if (mEGLDisplay == EGL14.EGL_NO_DISPLAY) {
LiteavLog.e(TAG, "unable to get EGL10 display"); checkEglError("unable to get EGL10 display");
return false; return false;
} }
int[] version = new int[2]; int[] version = new int[2];
if (!EGL14.eglInitialize(mEGLDisplay, version, 0, version, 1)) { if (!EGL14.eglInitialize(mEGLDisplay, version, 0, version, 1)) {
LiteavLog.e(TAG, "unable to initialize EGL10"); checkEglError("unable to initialize EGL10");
return false; return false;
} }
int[] maxSamples = new int[1];
GLES30.glGetIntegerv(GLES30.GL_MAX_SAMPLES, maxSamples, 0);
//noinspection ExtractMethodRecommender
final int samples = Math.min(4, maxSamples[0]);
// Configure EGL for pbuffer and OpenGL ES 2.0, 24-bit RGB. // Configure EGL for pbuffer and OpenGL ES 2.0, 24-bit RGB.
int[] attribList = new int[]{ int[] attribList = new int[]{
EGL14.EGL_RED_SIZE, 8, EGL14.EGL_RED_SIZE, 8,
EGL14.EGL_GREEN_SIZE, 8, EGL14.EGL_GREEN_SIZE, 8,
EGL14.EGL_BLUE_SIZE, 8, EGL14.EGL_BLUE_SIZE, 8,
EGL14.EGL_ALPHA_SIZE, 8, EGL14.EGL_ALPHA_SIZE, 8,
EGL14.EGL_DEPTH_SIZE, 8,
EGL14.EGL_RENDERABLE_TYPE, EGL14.EGL_OPENGL_ES2_BIT, EGL14.EGL_RENDERABLE_TYPE, EGL14.EGL_OPENGL_ES2_BIT,
EGL14.EGL_SURFACE_TYPE, EGL14.EGL_WINDOW_BIT, EGL14.EGL_SURFACE_TYPE, EGL14.EGL_WINDOW_BIT,
EGL14.EGL_SAMPLE_BUFFERS, 1,
EGL14.EGL_SAMPLES, samples,
EGL14.EGL_NONE EGL14.EGL_NONE
}; };
...@@ -242,13 +236,13 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener { ...@@ -242,13 +236,13 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
EGLConfig[] eglConfigs = new EGLConfig[1]; EGLConfig[] eglConfigs = new EGLConfig[1];
if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, eglConfigs, 0, if (!EGL14.eglChooseConfig(mEGLDisplay, attribList, 0, eglConfigs, 0,
eglConfigs.length, numEglConfigs, 0)) { eglConfigs.length, numEglConfigs, 0)) {
LiteavLog.e(TAG, "eglChooseConfig error"); checkEglError("eglChooseConfig error");
return false; return false;
} }
// Configure context for OpenGL ES 2.0. // Configure context for OpenGL ES 2.0.
//6、创建 EglContext //6、创建 EglContext
int[] attrib_list = new int[]{ int[] attrib_list = new int[]{
EGL14.EGL_CONTEXT_CLIENT_VERSION, 3, EGL14.EGL_CONTEXT_CLIENT_VERSION, 2,
EGL14.EGL_NONE EGL14.EGL_NONE
}; };
...@@ -271,6 +265,7 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener { ...@@ -271,6 +265,7 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
LiteavLog.e(TAG, "surface was null"); LiteavLog.e(TAG, "surface was null");
return false; return false;
} }
mOutPutSurface = surface;
return true; return true;
} }
...@@ -279,6 +274,8 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener { ...@@ -279,6 +274,8 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
if ((error = EGL14.eglGetError()) != EGL14.EGL_SUCCESS) { if ((error = EGL14.eglGetError()) != EGL14.EGL_SUCCESS) {
LiteavLog.e(TAG, "checkEglError: " + msg + "error: " + error); LiteavLog.e(TAG, "checkEglError: " + msg + "error: " + error);
return false; return false;
} else {
LiteavLog.e(TAG, msg);
} }
return true; return true;
...@@ -287,16 +284,15 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener { ...@@ -287,16 +284,15 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
public boolean makeCurrent(int index) { public boolean makeCurrent(int index) {
if (index == 0) { if (index == 0) {
if (!EGL14.eglMakeCurrent(mEGLDisplay, mEGLSurface, mEGLSurface, mEGLContext)) { if (!EGL14.eglMakeCurrent(mEGLDisplay, mEGLSurface, mEGLSurface, mEGLContext)) {
LiteavLog.e(TAG, "eglMakeCurrent failed"); checkEglError("makeCurrent");
return false; return false;
} }
} else { } else {
if (!EGL14.eglMakeCurrent(mEGLDisplay, mEGLSurfaceEncoder, mEGLSurfaceEncoder, mEGLContextEncoder)) { if (!EGL14.eglMakeCurrent(mEGLDisplay, mEGLSurfaceEncoder, mEGLSurfaceEncoder, mEGLContextEncoder)) {
LiteavLog.e(TAG, "eglMakeCurrent failed"); checkEglError("makeCurrent");
return false; return false;
} }
} }
return true; return true;
} }
...@@ -313,11 +309,6 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener { ...@@ -313,11 +309,6 @@ public class FTXEGLRender implements SurfaceTexture.OnFrameAvailableListener {
mEGLSavedContext = EGL14.eglGetCurrentContext(); mEGLSavedContext = EGL14.eglGetCurrentContext();
mEGLSaveDrawSurface = EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW); mEGLSaveDrawSurface = EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW);
mEGLSaveReadSurface = EGL14.eglGetCurrentSurface(EGL14.EGL_READ); mEGLSaveReadSurface = EGL14.eglGetCurrentSurface(EGL14.EGL_READ);
// // 检查有效性
// if (mEGLSavedDisplay == EGL14.EGL_NO_DISPLAY || mEGLSavedContext == EGL14.EGL_NO_CONTEXT) {
// LiteavLog.w(TAG, "Saving invalid EGL state");
// }
} catch (Exception e) { } catch (Exception e) {
LiteavLog.e(TAG, "Save EGL error: " + e); LiteavLog.e(TAG, "Save EGL error: " + e);
resetSavedEnvironment(); resetSavedEnvironment();
......
package com.tencent.vod.flutter.player.render.gl; package com.tencent.vod.flutter.player.render.gl;
import android.opengl.GLES11Ext; import android.opengl.GLES11Ext;
import android.opengl.GLES30; import android.opengl.GLES20;
import android.opengl.Matrix; import android.opengl.Matrix;
import com.tencent.liteav.base.util.LiteavLog; import com.tencent.liteav.base.util.LiteavLog;
...@@ -82,10 +82,10 @@ public class FTXTextureRender { ...@@ -82,10 +82,10 @@ public class FTXTextureRender {
*/ */
public void surfaceCreated() { public void surfaceCreated() {
mVideoFragmentProgram = TXGlUtilVideo.createProgram(VERTEX_SHADER, VIDEO_FRAGMENT_SHADER); mVideoFragmentProgram = TXGlUtilVideo.createProgram(VERTEX_SHADER, VIDEO_FRAGMENT_SHADER);
maPositionHandle = GLES30.glGetAttribLocation(mVideoFragmentProgram, "aPosition"); maPositionHandle = GLES20.glGetAttribLocation(mVideoFragmentProgram, "aPosition");
maTexCoordHandle = GLES30.glGetAttribLocation(mVideoFragmentProgram, "aTextureCoord"); maTexCoordHandle = GLES20.glGetAttribLocation(mVideoFragmentProgram, "aTextureCoord");
muMVPMatrixHandle = GLES30.glGetUniformLocation(mVideoFragmentProgram, "uMVPMatrix"); muMVPMatrixHandle = GLES20.glGetUniformLocation(mVideoFragmentProgram, "uMVPMatrix");
maTextureHandle = GLES30.glGetUniformLocation(mVideoFragmentProgram, "sTexture"); maTextureHandle = GLES20.glGetUniformLocation(mVideoFragmentProgram, "sTexture");
textureID[0] = initTex(); textureID[0] = initTex();
} }
...@@ -95,8 +95,8 @@ public class FTXTextureRender { ...@@ -95,8 +95,8 @@ public class FTXTextureRender {
} }
public void deleteTexture() { public void deleteTexture() {
GLES30.glDeleteProgram(mVideoFragmentProgram); GLES20.glDeleteProgram(mVideoFragmentProgram);
GLES30.glDeleteTextures(1, textureID, 0); GLES20.glDeleteTextures(1, textureID, 0);
} }
/** /**
...@@ -106,17 +106,17 @@ public class FTXTextureRender { ...@@ -106,17 +106,17 @@ public class FTXTextureRender {
*/ */
public int initTex() { public int initTex() {
int[] tex = new int[1]; int[] tex = new int[1];
GLES30.glGenTextures(1, tex, 0); GLES20.glGenTextures(1, tex, 0);
GLES30.glActiveTexture(GLES30.GL_TEXTURE0); GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
GLES30.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, tex[0]); GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, tex[0]);
GLES30.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
GLES30.GL_TEXTURE_WRAP_S, GLES30.GL_CLAMP_TO_EDGE); GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
GLES30.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
GLES30.GL_TEXTURE_WRAP_T, GLES30.GL_CLAMP_TO_EDGE); GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
GLES30.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
GLES30.GL_TEXTURE_MIN_FILTER, GLES30.GL_LINEAR); GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
GLES30.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES,
GLES30.GL_TEXTURE_MAG_FILTER, GLES30.GL_LINEAR); GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
return tex[0]; return tex[0];
} }
...@@ -201,8 +201,8 @@ public class FTXTextureRender { ...@@ -201,8 +201,8 @@ public class FTXTextureRender {
} }
public void cleanDrawCache() { public void cleanDrawCache() {
GLES30.glViewport(0, 0, mPortWidth, mPortHeight); GLES20.glViewport(0, 0, mPortWidth, mPortHeight);
GLES30.glClear(GLES30.GL_COLOR_BUFFER_BIT); GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
} }
/** /**
...@@ -211,30 +211,30 @@ public class FTXTextureRender { ...@@ -211,30 +211,30 @@ public class FTXTextureRender {
public void drawFrame() { public void drawFrame() {
cleanDrawCache(); cleanDrawCache();
// video frame // video frame
GLES30.glUseProgram(mVideoFragmentProgram); GLES20.glUseProgram(mVideoFragmentProgram);
// OpenGL rotates counterclockwise, here it needs to be modified to rotate clockwise // OpenGL rotates counterclockwise, here it needs to be modified to rotate clockwise
GLES30.glUniformMatrix4fv(muMVPMatrixHandle, 1, false, mResultMatrix, 0); GLES20.glUniformMatrix4fv(muMVPMatrixHandle, 1, false, mResultMatrix, 0);
GLES30.glActiveTexture(GLES30.GL_TEXTURE0); GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
GLES30.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, textureID[0]); GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, textureID[0]);
GLES30.glUniform1i(maTextureHandle, 0); GLES20.glUniform1i(maTextureHandle, 0);
// Enable the "aPosition" vertex attribute. // Enable the "aPosition" vertex attribute.
GLES30.glEnableVertexAttribArray(maPositionHandle); GLES20.glEnableVertexAttribArray(maPositionHandle);
// Connect vertexBuffer to "aPosition". // Connect vertexBuffer to "aPosition".
GLES30.glVertexAttribPointer(maPositionHandle, 3, GLES20.glVertexAttribPointer(maPositionHandle, 3,
GLES30.GL_FLOAT, false, 3 * FLOAT_SIZE_BYTES, FULL_RECTANGLE_BUF); GLES20.GL_FLOAT, false, 3 * FLOAT_SIZE_BYTES, FULL_RECTANGLE_BUF);
// Enable the "aTextureCoord" vertex attribute. // Enable the "aTextureCoord" vertex attribute.
GLES30.glEnableVertexAttribArray(maTexCoordHandle); GLES20.glEnableVertexAttribArray(maTexCoordHandle);
// Connect texBuffer to "aTextureCoord". // Connect texBuffer to "aTextureCoord".
GLES30.glVertexAttribPointer(maTexCoordHandle, 4, GLES20.glVertexAttribPointer(maTexCoordHandle, 4,
GLES30.GL_FLOAT, false, 4 * FLOAT_SIZE_BYTES, FULL_RECTANGLE_TEX_BUF); GLES20.GL_FLOAT, false, 4 * FLOAT_SIZE_BYTES, FULL_RECTANGLE_TEX_BUF);
// Draw the rect. // Draw the rect.
GLES30.glDrawArrays(GLES30.GL_TRIANGLE_STRIP, 0, 4); GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
// Done -- disable vertex array, texture, and program. // Done -- disable vertex array, texture, and program.
GLES30.glDisableVertexAttribArray(maPositionHandle); GLES20.glDisableVertexAttribArray(maPositionHandle);
GLES30.glDisableVertexAttribArray(maTexCoordHandle); GLES20.glDisableVertexAttribArray(maTexCoordHandle);
GLES30.glUseProgram(0); GLES20.glUseProgram(0);
} }
} }
...@@ -30,21 +30,11 @@ class _DemoShortVideoPlayerState extends State<DemoShortVideoPlayer> with Widget ...@@ -30,21 +30,11 @@ class _DemoShortVideoPlayerState extends State<DemoShortVideoPlayer> with Widget
void _loadData() async { void _loadData() async {
// check license // check license
final ShortVideoDataLoader loader = ShortVideoDataLoader(); final ShortVideoDataLoader loader = ShortVideoDataLoader();
if (!isLicenseSuc.isCompleted) { loader.getPageListDataOneByOneFunction((dataModels) {
SuperPlayerPlugin.setGlobalLicense(LICENSE_URL, LICENSE_KEY); setState(() {
await isLicenseSuc.future; superPlayerModelList = dataModels;
loader.getPageListDataOneByOneFunction((dataModels) {
setState(() {
superPlayerModelList = dataModels;
});
}); });
} else { });
loader.getPageListDataOneByOneFunction((dataModels) {
setState(() {
superPlayerModelList = dataModels;
});
});
}
} }
@override @override
......
...@@ -299,14 +299,7 @@ class _DemoSuperPlayerState extends State<DemoSuperPlayer> with TXPipPlayerResto ...@@ -299,14 +299,7 @@ class _DemoSuperPlayerState extends State<DemoSuperPlayer> with TXPipPlayerResto
void playCurrentModel(SuperPlayerModel model, double startTime) async { void playCurrentModel(SuperPlayerModel model, double startTime) async {
currentVideoModel = model; currentVideoModel = model;
await _controller.setStartTime(startTime); await _controller.setStartTime(startTime);
// check license await _controller.playWithModelNeedLicence(model);
if (!isLicenseSuc.isCompleted) {
SuperPlayerPlugin.setGlobalLicense(LICENSE_URL, LICENSE_KEY);
await isLicenseSuc.future;
await _controller.playWithModelNeedLicence(model);
} else {
await _controller.playWithModelNeedLicence(model);
}
} }
void playVideo(SuperPlayerModel model) { void playVideo(SuperPlayerModel model) {
......
...@@ -65,14 +65,7 @@ class _DemoTXLivePlayerState extends State<DemoTXLivePlayer> with WidgetsBinding ...@@ -65,14 +65,7 @@ class _DemoTXLivePlayerState extends State<DemoTXLivePlayer> with WidgetsBinding
}); });
_controller.setRenderMode(FTXPlayerRenderMode.ADJUST_RESOLUTION); _controller.setRenderMode(FTXPlayerRenderMode.ADJUST_RESOLUTION);
await _controller.startLivePlay(_url);
if (!isLicenseSuc.isCompleted) {
SuperPlayerPlugin.setGlobalLicense(LICENSE_URL, LICENSE_KEY);
await isLicenseSuc.future;
await _controller.startLivePlay(_url);
} else {
await _controller.startLivePlay(_url);
}
} }
@override @override
......
...@@ -76,13 +76,7 @@ class _DemoTXVodPlayerState extends State<DemoTXVodPlayer> with WidgetsBindingOb ...@@ -76,13 +76,7 @@ class _DemoTXVodPlayerState extends State<DemoTXVodPlayer> with WidgetsBindingOb
await _controller.setConfig(FTXVodPlayConfig()); await _controller.setConfig(FTXVodPlayConfig());
await _controller.setRenderMode(_renderMode); await _controller.setRenderMode(_renderMode);
if (!isLicenseSuc.isCompleted) { await _controller.startVodPlay(_url);
SuperPlayerPlugin.setGlobalLicense(LICENSE_URL, LICENSE_KEY);
await isLicenseSuc.future;
await _controller.startVodPlay(_url);
} else {
await _controller.startVodPlay(_url);
}
} }
@override @override
......
...@@ -113,7 +113,6 @@ class _MyAppState extends State<MyApp> { ...@@ -113,7 +113,6 @@ class _MyAppState extends State<MyApp> {
return MaterialApp( return MaterialApp(
localizationsDelegates: [ localizationsDelegates: [
AppLocalizationDelegate.delegate, AppLocalizationDelegate.delegate,
SuperPlayerWidgetLocals.delegate,
GlobalWidgetsLocalizations.delegate, GlobalWidgetsLocalizations.delegate,
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
GlobalCupertinoLocalizations.delegate, GlobalCupertinoLocalizations.delegate,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'super_player' s.name = 'super_player'
s.version = '12.8.0' s.version = '12.8.1'
s.summary = 'The super_player Flutter plugin is one of the sub-product SDKs of the audio/video terminal SDK (Tencent Cloud Video on Demand).' s.summary = 'The super_player Flutter plugin is one of the sub-product SDKs of the audio/video terminal SDK (Tencent Cloud Video on Demand).'
s.description = <<-DESC s.description = <<-DESC
player plugin. player plugin.
......
...@@ -2,5 +2,5 @@ ...@@ -2,5 +2,5 @@
part of SuperPlayer; part of SuperPlayer;
abstract class FPlayerPckInfo { abstract class FPlayerPckInfo {
static const String PLAYER_VERSION = "12.8.0"; static const String PLAYER_VERSION = "12.8.1";
} }
\ No newline at end of file
name: super_player name: super_player
description: The super_player Flutter plugin is one of the sub-product SDKs of the audio/video terminal SDK (Tencent Cloud Video on Demand). description: The super_player Flutter plugin is one of the sub-product SDKs of the audio/video terminal SDK (Tencent Cloud Video on Demand).
version: 12.8.0 version: 12.8.1
homepage: https://github.com/LiteAVSDK/Player_Flutter homepage: https://github.com/LiteAVSDK/Player_Flutter
environment: environment:
......
...@@ -3,5 +3,5 @@ part of demo_super_player_lib; ...@@ -3,5 +3,5 @@ part of demo_super_player_lib;
class PlayerConstants { class PlayerConstants {
static const PKG_NAME = "superplayer_widget"; static const PKG_NAME = "superplayer_widget";
static const String PLAYER_WIDGET_VERSION = "12.8.0"; static const String PLAYER_WIDGET_VERSION = "12.8.1";
} }
...@@ -8,8 +8,11 @@ int manualOrientationDirection = TXVodPlayEvent.ORIENTATION_LANDSCAPE_RIGHT; ...@@ -8,8 +8,11 @@ int manualOrientationDirection = TXVodPlayEvent.ORIENTATION_LANDSCAPE_RIGHT;
class SuperPlayerView extends StatefulWidget { class SuperPlayerView extends StatefulWidget {
final SuperPlayerController _controller; final SuperPlayerController _controller;
final SuperPlayerRenderMode renderMode; final SuperPlayerRenderMode renderMode;
LocalizationsDelegate<dynamic>? customLocalDelegate;
SuperPlayerView(this._controller, {Key? viewKey, this.renderMode = SuperPlayerRenderMode.ADJUST_RESOLUTION}) : super(key: viewKey); SuperPlayerView(this._controller,
{Key? viewKey, this.renderMode = SuperPlayerRenderMode.ADJUST_RESOLUTION, this.customLocalDelegate})
: super(key: viewKey);
@override @override
State<StatefulWidget> createState() => SuperPlayerViewState(); State<StatefulWidget> createState() => SuperPlayerViewState();
...@@ -437,9 +440,20 @@ class SuperPlayerViewState extends State<SuperPlayerView> with WidgetsBindingObs ...@@ -437,9 +440,20 @@ class SuperPlayerViewState extends State<SuperPlayerView> with WidgetsBindingObs
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Localizations.override(
body: SafeArea(left: false, right: false, top: false, bottom: false, minimum: EdgeInsets.zero, context: context,
child: _getNoPaddingBody(context)), delegates: [
widget.customLocalDelegate ?? SuperPlayerWidgetLocals.delegate
],
child: Scaffold(
body: SafeArea(
left: false,
right: false,
top: false,
bottom: false,
minimum: EdgeInsets.zero,
child: _getNoPaddingBody(context)),
),
); );
} }
......
name: superplayer_widget name: superplayer_widget
description: superplayer,base on vodplayer description: superplayer,base on vodplayer
version: 12.8.0 version: 12.8.1
environment: environment:
sdk: '>=2.17.0 <4.0.0' sdk: '>=2.17.0 <4.0.0'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论