Skip to content
tom edited this page Mar 26, 2018 · 3 revisions

Q1:How to set use-agent?

A: videoView.getVideoInfo().addOption(Option.create(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "user_agent", "myAgent/1.0"));

Q2:How to support lazy load

A: compile 'com.github.tcking:giraffeplayer2:0.1.19-lazyLoad'

Q3: where the files download while using lazy load

A: download from github CDN: https://github.com/tcking/GiraffePlayerLazyLoadFiles

Q4: Can I download files from my server while using lazy load

A: Yes,first you copy so files to your server from https://github.com/tcking/GiraffePlayerLazyLoadFiles,and then setSoFetcher eg:

LazyLoadManager.setSoFetcher(new LazyLoadManager.SoFetcher() {
            @Override
            public String getURL(String abi, String soVersion) {
                return "your server url";
            }
        });

Q5: Can I configuration all players?

A: Yes,you can configuration all player by PlayerManager.getInstance().getDefaultVideoInfo(),eg:


PlayerManager.getInstance().getDefaultVideoInfo()
   //set user-agent for all players
  .addOption(Option.create(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "user_agent", "myAgent/1.0"));
   //Use persistent connections for all players
  .addOption(Option.create(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "multiple_requests", 1L))

Q6: How to set Cookie?

videoInfo.addOption(Option.create(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "headers", "Cookie: key=value\n"))