tcking / GiraffePlayer2

out of the box android video player(support lazy load, ListView/RecyclerView and hight performance)
Apache License 2.0
377 stars 110 forks source link

Unable to add option when using setPlayerImpl(VideoInfo.PLAYER_IMPL_SYSTEM) #143

Closed HazimSharif closed 5 years ago

HazimSharif commented 5 years ago

Hello Tcking,

I use the option "setPlayerImpl(VideoInfo.PLAYER_IMPL_SYSTEM)" to get rid of issue playing some HTTPS links, it works perfect, but i'm unable to add user-agent when using this option


                 GiraffePlayer.play(getContext(), new VideoInfo(LinkValue.get(position))
                                    .setTitle(item.getShowName() + ", " + item.getSeason() + " - " + item.getName())
                                    .setFullScreenOnly(true)
                                    .setPlayerImpl(VideoInfo.PLAYER_IMPL_SYSTEM)
                                    .setBgColor(Color.BLACK)
                                    .addOption(Option.create(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "headers",  LinkCookie.get(position) != null ? LinkCookie.get(position).replaceAll(";", "") : null))
                                    .addOption(Option.create(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "user-agent", GLOBAL_GIRAFFE.USERAGENT))
                    );

the option ".addOption(Option.create(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "user-agent", GLOBAL_GIRAFFE.USERAGENT))" has no effect, but when i remove ".setPlayerImpl(VideoInfo.PLAYER_IMPL_SYSTEM)", then user-agent works fine.

I was not able to test cookie as well, i think it will have same issue when using default android media player.

Please advise how i use the two options at same time.

Thanks a lot

tcking commented 5 years ago

this is a bug that addOptions "headers" not work for MediaPlayer, it will fixed at next version