diff --git a/app/build.gradle b/app/build.gradle index 599cbaeef..dcd4f005f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,7 +11,7 @@ android { minSdk 21 targetSdk 28 versionCode 207 - versionName "20231116#2" + versionName "20231118" javaCompileOptions { annotationProcessorOptions { arguments = ["room.schemaLocation": "$projectDir/schemas".toString()] diff --git a/app/src/leanback/java/com/fongmi/android/tv/ui/activity/LiveActivity.java b/app/src/leanback/java/com/fongmi/android/tv/ui/activity/LiveActivity.java index 1655ad202..436f67b2e 100644 --- a/app/src/leanback/java/com/fongmi/android/tv/ui/activity/LiveActivity.java +++ b/app/src/leanback/java/com/fongmi/android/tv/ui/activity/LiveActivity.java @@ -544,10 +544,8 @@ public class LiveActivity extends BaseActivity implements GroupPresenter.OnClick private void setInfo() { mChannel.loadLogo(mBinding.widget.logo); mBinding.widget.name.setText(mChannel.getName()); - mBinding.control.name.setText(mChannel.getName()); mBinding.widget.line.setText(mChannel.getLineText()); mBinding.widget.number.setText(mChannel.getNumber()); - mBinding.control.number.setText(mChannel.getNumber()); mBinding.control.line.setText(mChannel.getLineText()); mBinding.widget.line.setVisibility(mChannel.getLineVisible()); mBinding.control.line.setVisibility(mChannel.getLineVisible()); diff --git a/app/src/leanback/res/layout/activity_live.xml b/app/src/leanback/res/layout/activity_live.xml index 43b1d7e93..58271b9dc 100644 --- a/app/src/leanback/res/layout/activity_live.xml +++ b/app/src/leanback/res/layout/activity_live.xml @@ -64,7 +64,7 @@ diff --git a/app/src/leanback/res/layout/view_control_live.xml b/app/src/leanback/res/layout/view_control_live.xml index 4562cf928..a175fbb40 100644 --- a/app/src/leanback/res/layout/view_control_live.xml +++ b/app/src/leanback/res/layout/view_control_live.xml @@ -17,26 +17,6 @@ android:gravity="center_vertical" android:orientation="horizontal"> - - - - + tools:text="首頁" /> + android:visibility="gone" + tools:visibility="visible" /> - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - package tv.danmaku.ijk.media.player; -public interface IjkLibLoader { - void loadLibrary(String libName) throws UnsatisfiedLinkError, SecurityException; +import android.util.Log; + +import java.util.Arrays; + +public abstract class IjkLibLoader { + + private static final String TAG = "IjkLibLoader"; + + private final String[] nativeLibraries; + private boolean loadAttempted; + private boolean isAvailable; + + public IjkLibLoader(String... libraries) { + nativeLibraries = libraries; + } + + public synchronized boolean isAvailable() { + if (loadAttempted) return isAvailable; + loadAttempted = true; + try { + for (String lib : nativeLibraries) { + loadLibrary(lib); + } + isAvailable = true; + } catch (Throwable exception) { + // Log a warning as an attempt to check for the library indicates that the app depends on an + // extension and generally would expect its native libraries to be available. + Log.w(TAG, "Failed to load " + Arrays.toString(nativeLibraries)); + } + return isAvailable; + } + + protected abstract void loadLibrary(String name); } diff --git a/ijkplayer/src/main/java/tv/danmaku/ijk/media/player/IjkMediaPlayer.java b/ijkplayer/src/main/java/tv/danmaku/ijk/media/player/IjkMediaPlayer.java index f785aa88e..b6df2b28c 100644 --- a/ijkplayer/src/main/java/tv/danmaku/ijk/media/player/IjkMediaPlayer.java +++ b/ijkplayer/src/main/java/tv/danmaku/ijk/media/player/IjkMediaPlayer.java @@ -36,7 +36,6 @@ import android.view.Surface; import android.view.SurfaceHolder; import androidx.annotation.NonNull; -import androidx.media3.common.util.LibraryLoader; import com.google.common.net.HttpHeaders; @@ -148,13 +147,10 @@ public final class IjkMediaPlayer extends AbstractMediaPlayer { private long mNativeMediaPlayer; @AccessedByNative private long mNativeMediaDataSource; - @AccessedByNative private long mNativeAndroidIO; - @AccessedByNative private int mNativeSurfaceTexture; - @AccessedByNative private int mListenerContext; @@ -169,7 +165,7 @@ public final class IjkMediaPlayer extends AbstractMediaPlayer { private int mVideoSarNum; private int mVideoSarDen; - private static final LibraryLoader LOADER = new LibraryLoader("ijkffmpeg", "ijksdl", "player") { + private static final IjkLibLoader LOADER = new IjkLibLoader("ijkffmpeg", "ijksdl", "player") { @Override protected void loadLibrary(@NonNull String name) { System.loadLibrary(name);