[英]Blank screen on video expand in android
我使用用于Android的JieCao播放器创建了一个示例应用程序,它在纵向和横向模式下(按扩展按钮)都可以完美运行。 但是,当我尝试将其集成到正在创建的另一个应用程序中时,按下视频扩展按钮会出现黑屏,但音频在后台播放。 无法得知发生这种情况的原因! 我已经在下面解释了我正在处理的代码:
jcVideoPlayerStandard = (JCVideoPlayerStandard) findViewById(R.id.custom_videoplayer_standard);
jcVideoPlayerStandard.setUp("http://2449.vod.myqcloud.com/2449_bfbbfa3cea8f11e5aac3db03cda99974.f20.mp4","");
ImageLoader.getInstance().displayImage("http://p.qpic.cn/videoyun/0/2449_bfbbfa3cea8f11e5aac3db03cda99974_1/640",jcVideoPlayerStandard.thumbImageView);
<fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard
android:id="@+id/custom_videoplayer_standard"
android:layout_width="match_parent"
android:layout_marginTop="55dp"
android:layout_height="250dp" />
和一个我包含在AndroidManifest文件中的单独的Java文件,尽管我非常确定它与错误无关。 这是代码:
public class VideoApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
LeakCanary.install(this);
initUniversalImageLoader();
}
private void initUniversalImageLoader() {
ImageLoaderConfiguration.Builder config = new ImageLoaderConfiguration.Builder(getApplicationContext());
config.threadPriority(Thread.NORM_PRIORITY - 2);
config.denyCacheImageMultipleSizesInMemory();
config.diskCacheFileNameGenerator(new Md5FileNameGenerator());
config.diskCacheSize(50 * 1024 * 1024); // 50 MiB
config.tasksProcessingOrder(QueueProcessingType.LIFO);
config.writeDebugLogs(); // Remove for releaseAllVideos app
config.defaultDisplayImageOptions(getDefaultDisplayImageOption());
// Initialize ImageLoader with configuration.
ImageLoader.getInstance().init(config.build());
}
public static DisplayImageOptions getDefaultDisplayImageOption() {
DisplayImageOptions options = new DisplayImageOptions.Builder()
.showImageOnLoading(new ColorDrawable(Color.parseColor("#f0f0f0")))
.resetViewBeforeLoading(true)
.cacheInMemory(true)
.cacheOnDisk(true)
.considerExifParams(true)
.imageScaleType(ImageScaleType.EXACTLY_STRETCHED)
.bitmapConfig(Bitmap.Config.RGB_565)
.displayer(new FadeInBitmapDisplayer(500))
.build();
return options;
}}
如果还有其他需要,请告诉我,我只想知道我要去哪里。
注意 :具有较高声誉的人请创建一个标签“ JieCao-player”,该标签在创建与此类别相关的问题时可能会很有用。 由于我的声誉不足,请做有需要的人。
只需确保在清单文件中的所有活动中将“ android:hardwareAccelerated”设置为true。 通过这样做,问题得以解决。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.