Render/Dispaly and Play youtube video embedded in pdf, Android - android

I have an PDF that contains hyperlinks and YouTube video embedded in it.
Target : Need to open PDF and all hyperlinks and videos should be working.
Findings : I have tried many of projects and third-party applications. Most of them use MuPDF, and are unable to play YouTube videos.
I can try out with native or PhoneGap.

We added support for YouTube and oder embedded media in v1.2 of PSPDFKit for Android. It's a commercial library and I am part of the team that builds it. Head over to https://pspdfkit.com/ and try the demo.
We're using the Picasso library on Android to show the videos. If you implement your own PDF rendering engine, this is definitely a good start. Synchronizing everything up turned out to be very tricky, and we ended re-implementing a custom scroll view to have maximum control over all aspects.

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.

Dailymotion Video in listview Android

How do I show the list of "DAILYMOTION" videos in android?
Also how do I play them?
I am able to play single video, but I now want to show more than 25 videos in a list.
How can I do this?
This is more works than supposed to be on a simple stackoverflow question!
You can:
list videos using Dailymotion API (documentation here https://developer.dailymotion.com/api)
and then play them using the Dailymotion video player. Here you'll find the documentation about the Android Player SDK: https://developer.dailymotion.com/tools/sdks#sdk-android that is a thin wrapper around a WebView that allows to easily embed Dailymotion videos into your Android application. You can check the source code, documentation and sample app on the GitHub repo: https://github.com/dailymotion/dailymotion-sdk-android/tree/master.
There even is a sample app that may help you get started! https://github.com/dailymotion/dailymotion-sdk-android/tree/master/SampleApp

mediaelement.js player and phonegap couldn't work on .apk file

I am trying to develop an application which is using mediaelement.js player. The styles, forward and backward buttons are not coming once I have created the android file. But it works in browser. Should I follow some other way to do this? When I searched, I have seen that to use media element API. But I cant find any API creation documents.

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.

Categories

Resources