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

Play video from URL on clicking play button In RecyclerView #105

Open
k2evil opened this issue Feb 24, 2019 · 1 comment
Open

Play video from URL on clicking play button In RecyclerView #105

k2evil opened this issue Feb 24, 2019 · 1 comment

Comments

@k2evil
Copy link

k2evil commented Feb 24, 2019

I'm trying to use your library for handling the playing one video at once. But there's a difference which I need to start the video whenever user clicked on play button.
I created an instance of VideoPlayerManager in my fragment and pass it to the Adapter in constructor.

In fragment :

private VideoPlayerManager<MetaData> mVideoPlayerManager = new SingleVideoPlayerManager(new PlayerItemChangeListener() {
    @Override
    public void onPlayerItemChanged(MetaData metaData) {

    }
});

public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
     ...
   adapter = new FeedsAdapter(getContext(), mVideoPlayerManager);
     ...
}

In adapter:

public FeedsAdapter(Context context, VideoPlayerManager videoPlayerManager) {
        super(context);
        mVideoPlayerManager = videoPlayerManager;
}

Now whenever user clicks on play button, I call this inside the adapter itself:

public void onBindItemViewHolder(FeedViewHolder holder, int position) {
        ...
        holder.imageviewPlayVideo.setOnClickListener(v -> {
                mVideoPlayerManager.playNewVideo(null, holder.videoview, url)
        }
        ...
}

The problem is that the VideoPlayerView is completely blank and only the sound of the video is playing. What am I missing?

@k2evil
Copy link
Author

k2evil commented Mar 3, 2019

@danylovolokh You are not supporting this library anymore?

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

1 participant