tcking / GiraffePlayer

android video player base on ijkplayer
Apache License 2.0
681 stars 199 forks source link

Error while loading player as header of Listview/Recyclerview. #66

Open alphaDroid89 opened 7 years ago

alphaDroid89 commented 7 years ago

Hi @tcking,

Thanks for this library. I faced the following issue while bind the video view as header in my ListView/RecyclerView.

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void tcking.github.com.giraffeplayer.IjkVideoView.setOnCompletionListener(tv.danmaku.ijk.media.player.IMediaPlayer$OnCompletionListener)' on a null object reference

I used the same code in Activity its working fine but inside the adapter i got the above error.

inside the adapter constructor i added like. GiraffePlayer mVideoPlayer = new GiraffePlayer(getActivity);

let me know how can i initialize player inside the adapter. Thanks in advance.

tcking commented 7 years ago

can u give me a demo code project?

shivanig30 commented 7 years ago

Same happening to me. @tcking , Can you please give me the suggestion?