Custom Video Player in android with youtube streaming capabilities - android

I have extended exoPlayer and have successfully got content on my server run. but problem is i dont have any clue how to integrate youtube without using youtubePlayer. i cant use standalone youtube player because of legal issues.
I have went through youtube data api doc but found little help out there.
any help would be appreciated.

Related

Exoplayer for Youtube videos

My goal is to play a Youtube video in an application.
Youtube Player API is not what I want since there could be overlays in front of the video.
Webviews are terrible for performances and doesn't allow autoplay.
Exoplayer seems good but most of their doc is broken (links), incredibly complex for a very simple task, and doesn't provide working demos (their demo crashes...). Also, they don't explain how to properly get the DASH of a youtube URL.
So, is there a way to make Exoplayer work easily and get DASH info of any youtube link like https://www.youtube.com/watch?v=yFAnn2j4iB0 ?
I use http://www.youtube.com/get_video_info?&video_id=yFAnn2j4iB0 and once decoded I get this DASH url : https://manifest.googlevideo.com/api/manifest/dash/ms/au/nh/IgpwcjAxLnBhcjAxKgkxMjcuMC4wLjE/mv/m/source/youtube/requiressl/yes/ip/165.225.76.70/fexp/3300108,3300130,3300161,3313267,9419451,9422596,9424135,9425619,9426788,9428398,9431012,9431719,9433096,9433223,9433946,9435526,9438327,9438662,9439580,9441225,9441737,9442156,9442424,9442426,9442680,9443322,9443345,9443768,9443913,9444207,9445344/ipbits/0/as/fmp4_audio_clear,webm_audio_clear,webm2_audio_clear,fmp4_sd_hd_clear,webm2_sd_hd_clear/sparams/as,hfr,id,initcwndbps,ip,ipbits,itag,mm,mn,ms,mv,nh,pl,playback_host,requiressl,source,expire/pl/23/id/c850279f68f8881d/mn/sn-25g7snee/mm/31/hfr/1/playback_host/r18---sn-25g7snee.googlevideo.com/itag/0/mt/1471872416/sver/3/key/yt6/initcwndbps/9365000/expire/1471894709/upn/w1CO218TeQA/s/11395DF1FE7737DA54826F38EE1C61D28B46619DC.9724AB654EE916E8B5C5F687BE3504E4799BA939933
But it doesn't start buffing in the Exoplayer Demo. Is this DASH correct ? Does anyone of you use ExoPlayer in their app ?
Doc I found so far :
How to play youtube video in ExoPlayer in Android?
https://github.com/google/ExoPlayer/tree/release-v1/demo_ext (but it crashes ><)
If your goal is to play YouTube videos then use YouTube Android Player API. You need to provide direct URL to Exoplayer.
I successfully run the demo app. you can follow the guide at https://google.github.io/ExoPlayer/demo-application.html and clone the project on github https://github.com/google/ExoPlayer.git
a little note though, it is the most complex project I've ever seen, and need the longest time I ever experienced to build its gradle.
after gradle build complete, you just need to run the demo project.

Cast Youtube videos inside my Android app directly to Youtube (in chromecast or roku or tv)

I am building an Android app with my youtube videos. I want to add casting support to these videos within my app. I don't want to build separate receiver app in chromecast but want to just use the existing youtube receiver app in chromecast/Roku..etc.
I am currently using 'Youtube Android Player' API to embed videos in my app but I can't find the cast support in-built. I am willing to move to just HTML5 youtube embedding if casting support works that way.
Would greatly appreciate if someone can suggest a way if they are able build such cast'ing support of youtube videos in their android app?
(I have researched internet and some of the 2013 & early '14 posts suggest it's not possible. Would like to know if anything has changed since then)
There is currently no support in the Cast SDK to cast YT videos; some folks have used a custom receiver and have used embedded iframe to show YT videos but that is not a perfect solution and has issues; for example you cannot skip ads, etc.

The most adaptable way to play YouTube Video in android application

I did google about this question and I found 4 possible ways to do it:
play the video with the following manner:
startActivity(newIntent(Intent.ACTION_VIEW,Uri.parse(uri)));
Get the RTSP link and play the video with VideoView
play the video using Flash
Using HTML5 iframe
I have an android 4.0 device and I am able to play YouTube videos using the first three methods. My question is: which method is the most adaptable to different version. If the answer is using HTML5, how can I do it. Thank you very much for your time.
The most allround way of doing it to open it with a URI parse. There is also a way of forcing the YouTube app to be called(sorry I think I read it someplace but I do not remember how) and show the video there. This means you do not get the option to chose to open the video in the browser.
The rest of the alternatives are only supported by some devices. (Flash is outdated, HTML5 is not supported on most devices). I you are going to do something else then using the buildt-in YouTube app I would recomend RTSP as the best option.

Play youtube video In App in android

In my android application I want to play youtube video in App, not in the default browser. I am trying this for the last some days. Previously I played the youtube video using the following code :
http://code.google.com/p/android-youtube-player/downloads/list
But now this code is not working. It shows "Sorry, this video cannot be played." I have tried all the possible solution mentioned in the different forum for this error. But could not be able to play the video.
That's why I am trying to find out another way to play the video in app. I have tried the RTSP link of a youtube video , it is playing the 3gp video file, but video quality is very poor. This is not acceptable.
I am really fade up to find out good solution to play youtube video in app.
Please help. Any good suggestion is always welcome.
Santanu
Playing YouTube videos in Android was made very simple with the release of this library: https://developers.google.com/youtube/android/player/. The Developer Guide on that page is a good resource on how to use this library. They also provide sample code on how to use the functionality provided by the library. The steps are basically:
Get a developer key
Download the library and include it in your project
Use the library to play videos (hint. use the YouTubePlayerView as a first step)
Please post again if you have any questions or need any code examples.
I play youtube video in videoview and I also face problem regarding video result.
Here some topics regarding this. One my friend suggest me use embeded URL instead of rtsp URL. Its give good result. For Example embeded URL example and how to implement it.

Android MediaPlayer, VideoView rtsp www authentication issue

Android VideoView works when I disable rtsp authentication from server side. But when authentication is enabled the VideoView fails to play the live stream.
Also tried
rtsp://username:password#host:port/file.sdp =>doesn't work.
But rtsp://host:port/file.sdp => Works when authentication is disable.
I have been working on this issue from past 2 weeks but did not find much help on this.
Or else if any open source rtsp player for android that support authentication will do.
Or any other workaround I can use to achieve this.
Guys please please help.
The Android MediaPlayer class support several media formats.
But regarding the RTSP protocol, the authentification is not supported.
You can find an open issue on the android project and an other interesting post about the problem.

Categories

Resources