I want to display the recently playing videos from a video streaming websites in a LinearLayout in my Android app. I know how to make an activity have a linear layout to put the videos to but I don't know how to get those videos from that website. Would I need JSON parsing to do it? Does anyone have any information about how to display recently playing videos on a video streaming website to an Android app (any links to useful stuff like API's etc) ? I tried Google but didn't get something useful.
If the website doesn't have a JSON interface (or any other). Then you should do scraping.
This involves downloading the HTML (via e.g. HttpClient), parsing the HTML and search for the video URLs.
Related
I have a webview which displays some HTML, and includes embedded YouTube videos. The videos are wrapped in an iframe tag and I have setJavascriptEnabled(true) in my Java file, so the video can play in the WebView. However, I would like to be able to launch Youtube when the user clicks the video.
Other posts on SO suggested that I parse out the video ID's and start an intent. However, this seems pretty tedious considering there can be multiple videos. In addition, I'm not sure how to set the iframe to clickable to listen for a click event.
Any suggestions?
Is it somehow possible, you can load the movie trailers from imdb to videoView or the native android player.
so far, what i've tried.
Iframe approach which let me load trailer in webview, which is exactly i don't want.
Here i found a link which is something a direct link to stream.
I want this to play in video view or native android control.
thanks in advance.
The link you have above is not a direct link to the video - it is actually a link to a web page which contains an embedded player, which in turn has a link to the actual trailer video itself.
You can see the link the to the video if you use the network timeline tab in a browser inspector to look at the network requests. For your example above the client (the browser running the HTML5 page you have downloaded) is requesting the video m3u8 file with the following request:
http://imdb-video.media-imdb.com/vi1225109529/1421100405014-mxwp62-1434643350557.m3u8
This is the 'index' file for a HLS format video file - it tells the client where to request the video streams. The client then downloads the video chunk by chunk which you can see as requests for TS segments - e.g. for you example above:
http://imdb-video.media-imdb.com/vi1225109529/1421100405014-mxwp62-143464335055700002.ts
If the IMDB site does not protect or restrict the video in some way (for example only allowing it play from their embedded web page) then in theory Android should be able to play a HLS file if you point the Media Player towards the m3u8 file. In practice however Android has well know issues with HLS playback so you may find it problematic - see this summary: http://www.jwplayer.com/blog/the-pain-of-live-streaming-on-android/
i am creating an app for my website which contains lots of wmv video files.
and i want to be able to play them in my app.
i understand that android does not support wmv files so my question is:
is there any way for me to do this without to change all videos format in my site?
any modificatios to my videos via code (java - eclipse) or libraries, any loop holes?
I've been trying to create a site that has streaming video and I could never get Android devices to work with it. Then I found this...
http://www.longtailvideo.com/blog/31646/the-pain-of-live-streaming-on-android
I have a web site and there are some videos on it.
I want to make Android app which doesn't load the whole web page, just the Video part. Is it possible? like loading youtube in WebView, but showing only video , not comments etc.
Thanks
create a video player in your app and based on the selected video load its URL to the video player and enable remote streaming to run the videos on the app. that should work.
It is a best way to make one web service in your website that can give you whatever you need from your website (This will also can be use to make change on your web service and get more or less content from your own website)
To use this things you need to parse your page with xml parser.
I have done my project this way which display my website's videos in my android
My website link
http://www.mycricketclips.com/.
I uses my android app to get all the displayed category and its video list in my android app.
and when I click on perticular video list, it will display that video on "webview" in android app.
Hope this might helpful for you.
I am trying to make an app that allows me to stream a video from a website and play that video in my app.
However, I would like to play this video from my app and not through youtube or anything else.
So you click a button and a video starts streaming and stays in my app and plays. Also, another quick question here, can I play videos from anywhere?
I think I read that it had to be .mp4 or something but im not sure. How can I tell if it's .mp4 by just looking at it?
If I really want to play a video that isnt .mp4 (or whatever it's supposed to be) is there any way at all that I could possibly play it?
The quickest way is to have a view dedicated to a Flash player which streams the video for you. You can generate the HTML at runtime and pass it into a WebView.
This is probably not what you are looking for because you mention that you want it to stream directly with Android. I thought I would put the suggestion out there though.
Edit:
You would use a WebView. Using the following function:
loadDataWithBaseURL(baseUrl, data, mimeType, encoding, historyUrl);
You pass in a base URL, which in this case can just be file:///android_asset/ and the data is your complete HTML code. etc.
The data would be set like so:
String data = "<html><head></head><body>flash player goes here</body></html>";
You would set the Flash player to occupy the whole screen, so that the size of the player is then determined by the size of your WebView.