halilozercan / BetterVideoPlayer

Video playback on Android, made better in Kotlin, wrapping around the stock MediaPlayer API.
287 stars 94 forks source link

Can't Stream #88

Open Aptul9 opened 5 years ago

Aptul9 commented 5 years ago

Hi, I really would like to integrate your player into my project. The actual problem is that it doesn't stream. I have followed your steps in the project description, however, I wasn't able to make it work. When I try to change the Uri.parse() section by inserting a link in it, into your sample project it just keeps loading without loading anything, it will just crash after a while (internet permission is added). Also, after converting the project to androidx in a new project of mine, when I add the player.setSource () it crashes. I am using the last version of Gradle and all libraries are updated. Thanks in advance

Aptul9 commented 5 years ago

Edit: there were some other errors, however the player stream is not working on api 28

skroth commented 5 years ago

@Aptul9 Are you running it on a real device or on an emulator? I was having trouble getting streaming to work on emulator but I've had it work on an actual device.

Aptul9 commented 5 years ago

I have tried several devices, both emulator and not. On devices with android 7or lower it works perfectly, but it doesn't on android 9 pie on api 28, I have tried on a samsung galaxy s8 with android pie. However somehow by lowering the api level to 27 it works. Try to stream on a api 28 phone and check it out by yourself. Thank you so much

halilozercan commented 5 years ago

Can you provide me the stream url that you are working with?

skroth commented 5 years ago

@Aptul9 actually that is consistent with what I'm seeing (the device I was using was pre 28 and the emulator was on 28). Are you streaming a video from the web or from your local computer? The stream URL I'm using is from localhost -- it's a video uploaded through the app I'm developing.

skroth commented 5 years ago

I've found that streaming the example video (http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4) on this project's main page works on API 28, and also streaming one of my videos from a test server works, it just doesn't work when being served from localhost. This sounds like an issue with MediaPlayer or a lower level HTTP library and not an issue with this project.

Aptul9 commented 5 years ago

@halilozercan @skroth thank you for your support. I am working with androidx repositories, all the libraries are updated to the latest version. I have tried to stream both the example video (http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4) Than some mp4 videos for other websites, such as: http://www.dragonballheroes.eu/DDL/ANIME/KazeGaTsuyokuFuiteiru/KazeGaTsuyokuFuiteiru_Ep_21_SUB_ITA.mp4

I have tried both kotlin-snapshot and 1.2 alpha 1 version (the updated one). The videos are not in localhost, as you can see they are uploaded on the web