SkyTubeTeam / SkyTube

Copylefted libre / open source YouTube player for Android
GNU General Public License v3.0
2.3k stars 320 forks source link

bug: certain network configuration trigger "cannot play this video" error #168

Open mcitew opened 6 years ago

mcitew commented 6 years ago

When configured with certain network configuration, all videos cannot be played, and an error message of "cannot play this video" will appear. However, the same video (and same network setup ) when select to open with external player such as youtube, can be played. Also, play the video using the standalone youtube app can be played in this network configuration.

The network configuration which I set up happen to include a wifi extender. Skytube is installed on the tv box, and both the tvbox and the phone are installed with "netshare-no-root-tethering", and the internet is established via the phone.

If the tv box where skytube is installed is connected to internet without going through this wifi range extender, it will not encounter this "cannot play this video" error.

So this is a bug shows up only in this wifi-extender configuration. The netshare-no-root-tethering network likely involves some proxy-ing which cause video decoding to fail.

Please let me know how to collect logs which is relevant with respect to solving this issue.

mcitew commented 6 years ago

The wifi extender software creates some tunnel interface and now I suspect SkyTube video stream retrieval is binding to the wrong network interface and as such unable to retrieve the video content. A zero byte content video causes the "cannot play this video" error.

ram-on commented 6 years ago

The wifi extender software creates some tunnel interface and now I suspect SkyTube video stream retrieval is binding to the wrong network interface and as such unable to retrieve the video content. A zero byte content video causes the "cannot play this video" error.

That's interesting as the app is not choosing any network interface by default (but rather using the one supplied by Android).

mcitew commented 6 years ago

It's only my guess right now. I wish I can furnish some kind of logs for this error.

Or the "double stage" network under some kind of VPN introduced by netshare-no-root-tethering cause SSL failure. The interesting part is other apps such as youtube do not fail in this setup.

ram-on commented 6 years ago

@mcitew I've just released another beta which will hopefully detect what is going wrong. Pls download it, re-run the app until the error reoccurs, then submit the logs.

mcitew commented 6 years ago

Attach the log using 'adb logcat'. log.txt

ram-on commented 6 years ago

@mcitew Thx for the log. I've analyzed it briefly.

Error code = 1 = MEDIA_ERROR_UNKNOWN Error Type = -1004 = MEDIA_ERROR_IO

I'll see if I can extra any additional information -- however I'll do that after the release.

In the meantime, I would appreciate if you list down the steps required to setup the netshare-no-root-tethering -- i.e. did you just download NetShare-no-root-tethering or did you require any additional hardware?

mcitew commented 6 years ago

Need two androids, eg a phone and TV box.

The app is loaded into the phone. Run this app as server/gateway. One side of the wifi will become a client to connect to the upstream internet via standard wifi services. Another side of wifi will become wifi tethering server exposing ssid and password allow clients to connect to it.

Then on the Android TV box, acting as a client, is configured to connect to this wifi using the ssid and password. When this completes, the TV box can connect to the internet using proxy/port. The Android TV box is also installed with the same netshare-no-root-tethering. This copy of app will then make some kind of VPN with the phone copy of app to allow the TV box transparent access to internet without needing to use application proxy/port.

In summary, one need to install netshare-no-root-tethering on the phone (as the WiFi extender) and also on the client machine where skytube is installed.

On the phone you can see connection info.

ram-on commented 6 years ago

Btw what operating system are you using and what is your device(s)?

mcitew commented 6 years ago

The device is a tvbox called MXQ pro+ 4k, running Marshmallow 6.0.1.

The thing to note is in this network set up, the same video can still be played if I use 'open with' and select an named player such as youtube or 'youtube for android tv' or even a browser. The problem is the 'open with' must always be manually selected.

mcitew commented 6 years ago

New and latest information. I override the DNS to use google DNS, then problem is gone. Seems google youtube player silently uses google DNS to lookup the stream server, which is why it is still able to stream the video. Perhaps skytube player uses system configured DNS which might have problem looking up the stream server.

ram-on commented 6 years ago

The problem is the 'open with' must always be manually selected

If you are using SkyTube Extra, you can use the Official YouTube player as your default one. Just go to Preferences > Video Player > tick Use official YouTube player

mcitew commented 6 years ago

There is a big difference in the outcome.

Using official YouTube player, certain videos will display 'This video contains content from xxxx, who has blocked it from display on this website or application'. However, when using 'open with' the video can be played without any problem. Furthermore, when using 'Open with' one can use an alternative player other than the youtube for phones. For my case, the preferred player is youtube for android TV ( com.google.android.youtube.tv).

In other words, the outcome of using 'open with' is very different from using the configured official player.