android-youtube-player icon indicating copy to clipboard operation
android-youtube-player copied to clipboard

YouTube live video playback by "https://www.youtube.com/embed/live_stream?channel=CHANNEL_ID"-like links

Open Armen-G-G opened this issue 4 years ago • 3 comments

I am developing an Android application that needs to be able to play YouTube live videos. Moreover, the application has a mode when two different streams are played simultaneously. I have found the ANDROID-YOUTUBE-PLAYER project. I tried to use this library - everything is very convenient and clear! And most importantly, so far only this library makes it possible to simultaneously play two or more YouTube videos in one application (in all other approaches only one of the videos displayed in the application can be played, all the others stop at that moment). However, I encountered such a feature of the live broadcasting system that every time I start a live broadcast on YouTube and receive a link to watch it, I get a new link every time (the part of link after "https://youtu.be/" everytime is different). Therefore, these links are not very convenient to use in my application. I found out that it is possible to embed links to livestreaming on YouTube into applications in the form of https://www.youtube.com/embed/live_stream?channel=CHANNEL_ID (this is a permanent kink). Tried using this approach. To do this, in the layout-file instead of

    <com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView
        android: layout_width = "match_parent"
        android: layout_height = "wrap_content"
        app: videoId = "AW0e8nm2gOs"
        app: autoPlay = "true"
        app: showYouTubeButton = "false" />

use

    <com.pierfrancescosoffritti.androidyoutubeplayer.core.player.views.YouTubePlayerView
        android: layout_width = "match_parent"
        android: layout_height = "wrap_content"
        app: videoId = "embed/live_stream?channel=CHANNEL_ID"
        app: autoPlay = "true"
        app: showYouTubeButton = "false" />

But with this approach, the player does not find the video and shows a playback error. Is it possible to configure YouTubePlayerView so that it plays videos from links like https://www.youtube.com/embed/live_stream?channel=CHANNEL_ID?

Armen-G-G avatar Nov 12 '20 15:11 Armen-G-G

Hi this is what I am exactly looking for. Have you found any solutions to this.

fantasticrahulrai avatar Dec 18 '20 07:12 fantasticrahulrai

Hi! Since 'android-youtube-player' does not support links like "live_stream", in my project I am currently using WebView. Using this calss it is possible to play the live_stream broadcast.

Armen-G-G avatar Dec 18 '20 14:12 Armen-G-G

Does this violate the play store's terms of services.

fantasticrahulrai avatar Dec 18 '20 14:12 fantasticrahulrai