Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

m3u8无法播放怎么办 #2743

Closed
hrxaoxin opened this issue May 27, 2020 · 1 comment
Closed

m3u8无法播放怎么办 #2743

hrxaoxin opened this issue May 27, 2020 · 1 comment

Comments

@hrxaoxin
Copy link

hrxaoxin commented May 27, 2020

(!!!!请务必务必按照issue模板,修改 后提交问题!!!!,不按模板提Isuue删除处理)

(ps 首页问题集锦和demo请先了解一下!)

提问前建议先看看: https://mp.weixin.qq.com/s/HjSdmAsHuvixCH_EWdvk3Q

问题描述:

部分m3u8无法播放

问题机型/系统:

例如 真机 小米mi6s

GSY依赖版本

例如 implementation 'com.shuyu:gsyVideoPlayer-java:7.1.4'

Demo中的复现步骤

问题代码:(如果有)

public void playVideoNet(String path,String title,String cover) {
VideoOptionModel videoOptionModel =
new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "protocol_whitelist", "crypto,file,http,https,tcp,tls,udp");
List list = new ArrayList<>();
list.add(videoOptionModel);
VideoOptionModel videoOptionModel1 = new VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "rtsp_transport", "tcp");
list.add(videoOptionModel1);
GSYVideoManager.instance().setOptionModelList(list);

    //        PlayerFactory.setPlayManager(Exo2PlayerManager.class);//EXO模式 有进度
    PlayerFactory.setPlayManager(SystemPlayerManager.class);//系统模式 //m3u8支持

// PlayerFactory.setPlayManager(IjkPlayerManager.class);//ijk模式 //无缓冲条
//exo缓存模式,支持m3u8,只支持exo
// CacheFactory.setCacheManager(ExoPlayerCacheManager.class);
//代理缓存模式,支持所有模式,不支持m3u8等,默认
// CacheFactory.setCacheManager(ProxyCacheManager.class);
// GSYVideoType.enableMediaCodec();
//切换绘制模式
// GSYVideoType.setRenderType(GSYVideoType.SUFRACE);
GSYVideoType.setRenderType(GSYVideoType.GLSURFACE);//m3u8支持
// GSYVideoType.setRenderType(GSYVideoType.TEXTURE);
GSYVideoType.enableMediaCodecTexture();
GSYVideoType.enableMediaCodec();
//切换渲染模式
GSYVideoType.setShowType(GSYVideoType.SCREEN_TYPE_DEFAULT);
//默认显示比例
// GSYVideoType.SCREEN_TYPE_DEFAULT = 0;
////16:9
// GSYVideoType.SCREEN_TYPE_16_9 = 1;
////4:3
// GSYVideoType.SCREEN_TYPE_4_3 = 2;
////全屏裁减显示,为了显示正常 CoverImageView 建议使用FrameLayout作为父布局
// GSYVideoType.SCREEN_TYPE_FULL = 4;
////全屏拉伸显示,使用这个属性时,surface_container建议使用FrameLayout
// GSYVideoType.SCREEN_MATCH_FULL = -4;

    //外部辅助的旋转,帮助全屏
    orientationUtils = new OrientationUtils(getActivity(), fragmentBinding.player);
    //初始化不打开外部的旋转
    orientationUtils.setEnable(false);
    orientationUtils.setIsLand(0);
    orientationUtils.setScreenType(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

// orientationUtils.setIsLand(1);
// orientationUtils.setScreenType(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
GSYVideoOptionBuilder gsyVideoOption = new GSYVideoOptionBuilder();
ImageView imageView = new ImageView(getActivity());
if (videoCover!=null)
fragmentBinding.player.setCover(videoCover);
if (cover != null) {
//增加封面
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
GlideHelper.showImage(getFragment(), imageView, cover, R.mipmap.video_adv_mr);
fragmentBinding.player.setThumbImageView(imageView);
}
fragmentBinding.player.setCover(cover);
// orientationUtils.setRotateWithSystem(true);
// orientationUtils.setScreenType(SCREEN_ORIENTATION_LANDSCAPE);
// orientationUtils.setIsLand(0);
gsyVideoOption.setThumbImageView(imageView)
.setIsTouchWiget(true)
.setRotateViewAuto(false)
.setLockLand(true)
.setAutoFullWithSize(false)
.setShowFullAnimation(false)
.setRotateWithSystem(true)
.setNeedShowWifiTip(false)
.setNeedLockFull(true)
.setStartAfterPrepared(true)
.setShowDragProgressTextOnSeekBar(true)
.setDismissControlTime(5000)
.setUrl(path)
.setCacheWithPlay(false)
// .setVideoTitle(title)
.setVideoAllCallBack(new GSYSampleCallBack() {
@OverRide
public void onPrepared(String url, Object... objects) {
super.onPrepared(url, objects);
fragmentBinding.player.startAfterPrepared();
//开始播放了才能旋转和全屏
isPlay = true;
}

                @Override
                public void onPlayError(String url, Object... objects) {
                    super.onPlayError(url, objects);
                    showToast("该视频播放异常");
                }

                @Override
                public void onClickStartError(String url, Object... objects) {
                    super.onClickStartError(url, objects);
                }

                @Override
                public void onQuitFullscreen(String url, Object... objects) {
                    super.onQuitFullscreen(url, objects);
                    Debuger.printfError("***** onQuitFullscreen **** " + objects[0]);//title
                    Debuger.printfError("***** onQuitFullscreen **** " + objects[1]);//当前非全屏player
                    if (orientationUtils != null) {
                        orientationUtils.backToProtVideo();
                    }
                }

                @Override
                public void onEnterFullscreen(String url, Object... objects) {
                    super.onEnterFullscreen(url, objects);
                }
            }).setLockClickListener(new LockClickListener() {
        @Override
        public void onClick(View view, boolean lock) {

// if (orientationUtils != null) {
// //配合下方的onConfigurationChanged
// orientationUtils.setEnable(!lock);
// }
}
}).build(fragmentBinding.player);
// GSYVideoControlView.generateViewId();
// GSYVideoManager;
// GSYBaseVideoPlayer;

    fragmentBinding.player.getBackButton().setOnClickListener(v -> {
        onBackPressed();
    });


    fragmentBinding.player.getCollect().setOnClickListener(v -> {

// m_type = "1";
// doLoveClick(videoID, m_type, "", class1, "", "");
});

    fragmentBinding.player.setOnCollectClickListener(v -> {

// m_type = "1";
// doLoveClick(videoID, m_type, "", class1, "", "");
});

    fragmentBinding.player.getFullscreenButton().setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            //直接横屏

// orientationUtils.resolveByClick();

            //第一个true是否需要隐藏actionbar,第二个true是否需要隐藏statusbar
            fragmentBinding.player.startWindowFullscreen(getActivity(), true, true);
        }
    });

// new Handler().postDelayed(new Runnable() {
// @OverRide
// public void run() {
// fragmentBinding.player.onPrepared();
fragmentBinding.player.startVideo();
// fragmentBinding.player.startAfterPrepared();
// }
// }, 5000);

}

问题log(如果有)

2020-05-27 18:25:13.083 1776-30721/system_process I/MediaFocusControl: AudioFocus abandonAudioFocus() from uid/pid 10627/24521 clientId=android.media.AudioManager@bc9e509com.shuyu.gsyvideoplayer.video.base.GSYVideoView$1@6b5730e
2020-05-27 18:25:13.084 1776-30721/system_process I/MediaFocusControl: AudioFocus removeFocusStackEntry(): removing entry for android.media.AudioManager@bc9e509com.shuyu.gsyvideoplayer.video.base.GSYVideoView$1@6b5730e
2020-05-27 18:25:13.085 1776-30721/system_process I/MediaFocusControl: AudioFocus abandonAudioFocus() from uid/pid 10627/24521 clientId=android.media.AudioManager@bc9e509com.shuyu.gsyvideoplayer.video.base.GSYVideoView$1@6b5730e
2020-05-27 18:25:13.087 1776-30721/system_process I/MediaFocusControl: AudioFocus requestAudioFocus() from uid/pid 10627/24521 clientId=android.media.AudioManager@bc9e509com.shuyu.gsyvideoplayer.video.base.GSYVideoView$1@6b5730e req=2 flags=0x0
2020-05-27 18:25:13.088 25895-25895/com.example.gsyvideoplayer D/AudioManager: AudioManager dispatching onAudioFocusChange(-2) for android.media.AudioManager@f61d29ccom.shuyu.gsyvideoplayer.video.base.GSYVideoView$1@b7a64a5
2020-05-27 18:25:13.106 24521-24521/com.hrx1.yy E/MediaPlayer-JNI: JNIMediaPlayerFactory: bIsQCMediaPlayerPresent 0
2020-05-27 18:25:13.106 24521-24521/com.hrx1.yy E/MediaPlayer-JNI: JNIMediaPlayerFactory: bIsQCMediaPlayerPresent 0
2020-05-27 18:25:13.107 24521-24521/com.hrx1.yy W/MediaPlayer: Couldn't open : java.io.FileNotFoundException: No content provider:
2020-05-27 18:25:13.112 24521-24521/com.hrx1.yy W/MediaPlayer: setScreenOnWhilePlaying(true) is ineffective without a SurfaceHolder
2020-05-27 18:25:13.114 25189-27954/? I/LiveSession: onConnect https://
2020-05-27 18:25:13.347 25189-27954/? I/LiveSession: #### Starting Bandwidth Switch: -1 => 0
2020-05-27 18:25:13.396 25189-27955/? E/HTTPDownloader: failed to parse .m3u8 playlist
2020-05-27 18:25:13.397 25189-27955/? E/PlaylistFetcher: failed to load playlist at url 'https://'

--------- beginning of crash

2020-05-27 18:25:13.447 25189-27955/? A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x1a in tid 27955 (Fetcher)
2020-05-27 18:25:13.449 629-629/? I/MIUINDBG_HOOK: hook hook_sigtimedwait
2020-05-27 18:25:13.518 27957-27957/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2020-05-27 18:25:13.519 27957-27957/? A/DEBUG: Build fingerprint: 'Xiaomi/sagit/sagit:7.1.1/NMF26X/7.11.30:user/release-keys'
2020-05-27 18:25:13.519 27957-27957/? A/DEBUG: Revision: '0'
2020-05-27 18:25:13.519 27957-27957/? A/DEBUG: ABI: 'arm'
2020-05-27 18:25:13.519 27957-27957/? A/DEBUG: pid: 25189, tid: 27955, name: Fetcher >>> /system/bin/mediaserver <<<
2020-05-27 18:25:13.519 27957-27957/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1a
2020-05-27 18:25:13.519 27957-27957/? A/DEBUG: r0 00000000 r1 00000000 r2 1eafee2b r3 00000000
2020-05-27 18:25:13.519 27957-27957/? A/DEBUG: r4 e697c040 r5 e47037dc r6 e470386c r7 00000020
2020-05-27 18:25:13.520 27957-27957/? A/DEBUG: r8 e47037ec r9 e47037d8 sl e47037e8 fp 00000000
2020-05-27 18:25:13.520 27957-27957/? A/DEBUG: ip e8513e04 sp e4703718 lr e850684b pc e8500e9a cpsr 600f0030
2020-05-27 18:25:13.526 27957-27957/? A/DEBUG: backtrace:
2020-05-27 18:25:13.526 27957-27957/? A/DEBUG: #00 pc 00015e9a /system/lib/libstagefright_httplive.so (_ZNK7android9M3UParser17isVariantPlaylistEv+3)
2020-05-27 18:25:13.526 27957-27957/? A/DEBUG: #1 pc 0001b847 /system/lib/libstagefright_httplive.so (ZN7android15PlaylistFetcher17initDownloadStateERNS_7AStringERNS_2spINS_8AMessageEEERiS7+698)
2020-05-27 18:25:13.526 27957-27957/? A/DEBUG: #2 pc 0001a7f7 /system/lib/libstagefright_httplive.so (_ZN7android15PlaylistFetcher14onDownloadNextEv+86)
2020-05-27 18:25:13.526 27957-27957/? A/DEBUG: #3 pc 00019e99 /system/lib/libstagefright_httplive.so (_ZN7android15PlaylistFetcher17onMessageReceivedERKNS_2spINS_8AMessageEEE+492)
2020-05-27 18:25:13.526 27957-27957/? A/DEBUG: #4 pc 0000f739 /system/lib/libstagefright_foundation.so (_ZN7android8AHandler14deliverMessageERKNS_2spINS_8AMessageEEE+24)
2020-05-27 18:25:13.526 27957-27957/? A/DEBUG: #5 pc 000119b5 /system/lib/libstagefright_foundation.so (_ZN7android8AMessage7deliverEv+64)
2020-05-27 18:25:13.527 27957-27957/? A/DEBUG: #6 pc 000102f3 /system/lib/libstagefright_foundation.so (_ZN7android7ALooper4loopEv+374)
2020-05-27 18:25:13.527 27957-27957/? A/DEBUG: #7 pc 0000e7b3 /system/lib/libutils.so (_ZN7android6Thread11_threadLoopEPv+134)
2020-05-27 18:25:13.527 27957-27957/? A/DEBUG: #8 pc 00047817 /system/lib/libc.so (_ZL15__pthread_startPv+22)
2020-05-27 18:25:13.527 27957-27957/? A/DEBUG: #9 pc 00019f95 /system/lib/libc.so (__start_thread+6)

--------- beginning of system

2020-05-27 18:25:13.705 1776-2162/system_process W/NativeCrashListener: Couldn't find ProcessRecord for pid 25189
2020-05-27 18:25:13.707 2847-2881/? I/octvm_klo: get event file: /data/tombstones/tombstone_01
2020-05-27 18:25:13.707 2847-2881/? I/octvm_klo: klo lock
2020-05-27 18:25:13.716 733-733/? I/ServiceManager: service 'media.player' died
2020-05-27 18:25:13.716 733-733/? I/ServiceManager: service 'media.resource_manager' died
2020-05-27 18:25:13.717 24521-24705/com.hrx1.yy W/IMediaDeathNotifier: media server died
2020-05-27 18:25:13.717 24521-24705/com.hrx1.yy E/MediaPlayer: error (100, 0)
2020-05-27 18:25:13.717 24521-24521/com.hrx1.yy E/MediaPlayer: Error (100,0)
2020-05-27 18:25:13.722 1776-1868/system_process I/BootReceiver: Copying /data/tombstones/tombstone_01 to DropBox (SYSTEM_TOMBSTONE)
2020-05-27 18:25:13.732 1776-1621/system_process I/NotificationService: cancelToast pkg=com.hrx1.yy callback=android.app.ITransientNotification$Stub$Proxy@752c38f
2020-05-27 18:25:13.732 1776-1621/system_process W/NotificationService: Toast already cancelled. pkg=com.hrx1.yy callback=android.app.ITransientNotification$Stub$Proxy@752c38f
2020-05-27 18:25:13.733 1776-1868/system_process W/DropBoxManagerService: Dropping: SYSTEM_TOMBSTONE (10 > 0 bytes)

@CarGuo
Copy link
Owner

CarGuo commented May 28, 2020

crpyto 的要用 api "com.shuyu:gsyVideoPlayer-ex_so:$gsyVideoVersion" ,还有大兄弟,你这链接···请不要用这类型的视频·····

Repository owner deleted a comment from hrxaoxin May 28, 2020
@CarGuo CarGuo closed this as completed May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants