Tolga Yavuz
Tolga Yavuz

Reputation: 159

Is it possible to buffer an audio file right before play on react-native-video?

I'm trying to play youtube videos as audio file in react-native-video with link gathered from react-native-ytdl. It is starts playing but I'm not unable to seek forward or backward. Is there any way to buffer audio file in memory? So maybe I can seek forward/backward with that method.

I am open to another solutions aswell.

Upvotes: 1

Views: 671

Answers (1)

Tolga Yavuz
Tolga Yavuz

Reputation: 159

I fixed the issue with changing my code to this;

const urls = await ytdl(youtubeURL, { filter: format => format.container === 'mp4' , quality: 'highestaudio', highWaterMark: 1024 * 1024 * 14 });

ytdl was using .webm for default and react-native-video can't buffer(or seek) .webm files but it is okay with mp4 now.

Upvotes: 1

Related Questions