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

How to add User Agent and Referer both in a single player? #152

Closed techcalibrator closed 5 years ago

techcalibrator commented 5 years ago

VideoInfo videoInfo = new VideoInfo(Uri.parse(swiftUrl)) .setTitle(channelsList.get(result).getChannelName())//config title .setAspectRatio(VideoInfo.AR_MATCH_PARENT) .addOption(Option.create(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "user_agent", "")) .addOption(Option.create(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "referer", "")); videoView.videoInfo(videoInfo).getPlayer().start();

tcking commented 5 years ago

.addOption(Option.create(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "headers", "referer: xxx\r\nuser-agent: okhttp\r\n"))

techcalibrator commented 5 years ago

Thanks @tcking