Previewing the live streaming video from the worldcam travel API - android

Can anybody tell me how can i play the live streaming cam video from this response of API world-cam..
I am getting problem to preview the video from this link directly :
{
"live": {
"available": true,
"embed": "https://api.lookr.com/embed/player/1485691420/live"
},
"day": {
"available": true,
"link": "https://www.lookr.com/lookout/1485691420#action-play-day",
"embed": "https://api.lookr.com/embed/player/1485691420/day"
},
"month": {
"available": true,
"link": "https://www.lookr.com/lookout/1485691420#action-play-month",
"embed": "https://api.lookr.com/embed/player/1485691420/month"
},
}

If you wish stream and play Video in Android App , you can use this library : Vitamio Library

Related

how to get youtube videos information in android? -kotlin

is there any chance to get video information with or without youtube APIs? right now I'm getting the thumbnail of videos using their video_id but I want information like title, description, views, YouTuber profile picture, and YouTuber name. I looked at youtube docs but just simple things like using players for playing videos.
this is the way I get thumbnails.
"https://img.youtube.com/vi/${videoID}/0.jpg"
also, I'm using youtube API for playing videos in my app with this code.
val intent = YouTubeStandalonePlayer.createVideoIntent(requireActivity(), "AIzaSyChnBzNGITQM2gUc52RnRfG3eDYmYRAhQ8", video_id)
startActivity(intent)
You can use these API to get video data
https://www.googleapis.com/youtube/v3/videos?id=VIDEO_ID&key=YOUR_API_KEY&part=snippet,statistics&fields=items(id,snippet,statistics)
Note: just add your API key in place of YOUR_API_KEY and pass videoId in place of VIDEO_ID.
API Response
{
"videos": [
{
"id": "7lCDEYXw3mM",
"snippet": {
"publishedAt": "2012-06-20T22:45:24.000Z",
"channelId": "UC_x5XG1OV2P6uZZ5FSM9Ttw",
"title": "Google I/O 101: Q&A On Using Google APIs",
"description": "Antonio Fuentes speaks to us and takes questions on working with Google APIs and OAuth 2.0.",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/7lCDEYXw3mM/default.jpg"
},
"medium": {
"url": "https://i.ytimg.com/vi/7lCDEYXw3mM/mqdefault.jpg"
},
"high": {
"url": "https://i.ytimg.com/vi/7lCDEYXw3mM/hqdefault.jpg"
}
},
"categoryId": "28"
},
"statistics": {
"viewCount": "3057",
"likeCount": "25",
"dislikeCount": "0",
"favoriteCount": "17",
"commentCount": "12"
}
}
]
}

Is it possible to get a cookie from an app?

I want to know that , Is it possible that we can access cookies from an app (android) for example - Currently i am logged in , in amazon videos . I want to access cookies (json id) or particularly like this:-
[
{
"domain": ".primevideo.com",
"expirationDate": 2183886856,
"hostOnly": false,
"httpOnly": true,
"name": "at-main-av",
"path": "/",
"sameSite": "no_restriction",
"secure": true,
"session": false,
"storeId": "0",
"value": "Atza|IwEBII7su3R9CsArd2BfylvT5To5LaOLd2gFKOn23APyjsGwk2ieHxH4PXzpHiZSRDXAJJEpRrE-RzYYFFAsLMKthk9ZX3SJ1WEWFzwxPEOhAGZiQO_e5x-sTNRyLbM8cJZZkBX6z738zkb0XLWGUFbY6Ny0Ls0ll9CcpgnhF9DAaHuibw7M9qBGdeNHREkEe2lrqoKu8xk1HbQbjMS59H43okkqRFtifAMmk4HNINlAPwJ7XooorOlZ9Nw48xgzd_m5j4yVz59nFCsUvGh9XF3DJjQidagWXnLTj2zSOYeLNdSu6ChedMo6CdQtXOGJN7vwfQMPT_A0L3KzXt_h38YRn8zDAz-y-r2TEzWV86FxmkZGycI2BeQhYZ6sDEG_7RwRwGpVtd33dCB1C6GMim5cXD4pluwO0BU3-N-kL1VqHP9FhnxFhvKuK4xQi72Mt4_YVcs",
"id": 1
}
]

Which Tag in Json file to fetch the YouTube Video on Android application on ListView Item?

Here is my json file i use thumbnail on listview but there no such tag that fetch videos . Define it which tag i use ?
That perfectly add thumbnail or other things
Below is my preview of Listview items
{
"kind": "youtube#playlistItemListResponse",
"etag": "\"GM4ZnRh2gk1X1BLWgHklTm-3cgQ/uvcwjZ_9_NYCLF7JAzfY5FiuzuQ\"",
"nextPageToken": "CAUQAA",
"pageInfo": {
"totalResults": 1998,
"resultsPerPage": 5
},
"items": [
{
"kind": "youtube#playlistItem",
"etag": "\"GM4ZnRh2gk1X1BLWgHklTm-3cgQ/dCBViPWfe-MGrqHIcuMZ55HcLJ0\"",
"id": "VVVHaENWR1owWlNwZTVoSkhXeWlMd0hBLlZHRHFaakFMSF9N",
"snippet": {
"publishedAt": "2017-01-26T08:58:26.000Z",
"channelId": "UCGhCVGZ0ZSpe5hJHWyiLwHA",
"title": "Top 10 - Scariest scenes in Resident evil 7",
"description": "Resident Evil 7 brings the series back to its roots while mak Epidemic Sound.\nhttp://www.epidemicsound.com/youtube-creator-subscription/",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/VGDqZjALH_M/default.jpg",
"width": 120,
"height": 90
},
},
"channelTitle": "ZoominGames",
"playlistId": "UUGhCVGZ0ZSpe5hJHWyiLwHA",
"position": 0,
"resourceId": {
"kind": "youtube#video",
"videoId": "VGDqZjALH_M"
}
}
},
Well, it is true that you cannot find any url in the json output. The only thing that you can get from here is the videoId.
You can use this videoId as part of this https://www.youtube.com/watch?v="insert_videoId" to get a video link.
So in your case, this is the link https://www.youtube.com/watch?v=VGDqZjALH_M

Parse json file that save on server in phonegap

My json file that have data
[
{
"id": 19,
"name": "Science",
"quiz": "quiz6"
},
{
"id": 21,
"name": "general knowledge",
"quiz": "For banking"
},
{
"id": 26,
"name": "Technologies",
"quiz": "arithmatic"
},
{
"id": 27,
"name": "english",
"quiz": "abcde"
},
{
"id": 28,
"name": "computer",
"quiz": "basic Question"
}
]
save on a server.Now i want to parse it in phonegap(android).How to do that.
When I save that file on my project and use it then it work, but when i use that file directly on server site then its not working.Is there any permission or plugin needed to access json on server side.
If in url i pass the "http://some folders/places.php" then it not work.
Thanks to all. Its working now.I try it on phone and its working.Actually my AVG software block my emulator to access the internet. Thats why it was not working.

Play a video with Twitter4j

I'm building an app for Android to read twitter feed I got an issue to play video from a tweet. Currently my tweet feed is showing the thumb image and when I click on it, if it's an image I show the image and in case of a video I expect to be able to play it.
To load the image, I'm doing:
ImageLoader mImageLoader = new ImageLoader(mActivity);
mImageLoader.DisplayImage(mPicToShowUrl, tweet_pic) ;
mPicToShowUrl is coming from :
mediaEntity.getMediaURL().toString();
mediaEntity is coming from the Twitter4j Status.getExpandedURL
tweet_pic is just an ImageView
The URL get look like : example.com/xxx/status/89284924/video/1 which is mainly unusable on any player as it do not contain something like xxx.com/1.avi
This kind of URL and ImageLoader allow to load an image. I'm looking for the same method for a video
I think the twitter video is more a streaming video
Any idea how to play a video from twitter in an ImageView or any other View ?
Thanks
You need to look in the extended_entities of the response. You'll see something like
"extended_entities": {
"media": [
{
"id": 567972074346807300,
"id_str": "567972074346807296",
"indices": [
46,
68
],
"media_url": "http://pbs.twimg.com/ext_tw_video_thumb/567972074346807296/pu/img/uz53Ap4wEah7cV50.jpg",
"media_url_https": "https://pbs.twimg.com/ext_tw_video_thumb/567972074346807296/pu/img/uz53Ap4wEah7cV50.jpg",
"url": "http://t.co/cGazAn7H3E",
"display_url": "pic.twitter.com/cGazAn7H3E",
"expanded_url": "http://twitter.com/katiemoffat/status/567972190639022080/video/1",
"type": "video",
"sizes": {
"small": {
"w": 340,
"h": 340,
"resize": "fit"
},
"thumb": {
"w": 150,
"h": 150,
"resize": "crop"
},
"medium": {
"w": 600,
"h": 600,
"resize": "fit"
},
"large": {
"w": 720,
"h": 720,
"resize": "fit"
}
},
"video_info": {
"aspect_ratio": [
1,
1
],
"duration_millis": 6605,
"variants": [
{
"bitrate": 832000,
"content_type": "video/mp4",
"url": "https://video.twimg.com/ext_tw_video/567972074346807296/pu/vid/480x480/eU1s1ig_skHgeRjB.mp4"
},
{
"content_type": "application/x-mpegURL",
"url": "https://video.twimg.com/ext_tw_video/567972074346807296/pu/pl/tr7sF7aHBPOCuL8H.m3u8"
},
{
"bitrate": 832000,
"content_type": "video/webm",
"url": "https://video.twimg.com/ext_tw_video/567972074346807296/pu/vid/480x480/eU1s1ig_skHgeRjB.webm"
},
{
"bitrate": 1280000,
"content_type": "video/mp4",
"url": "https://video.twimg.com/ext_tw_video/567972074346807296/pu/vid/720x720/njkDGgpJBpsTjQD3.mp4"
},
{
"bitrate": 320000,
"content_type": "video/mp4",
"url": "https://video.twimg.com/ext_tw_video/567972074346807296/pu/vid/240x240/Gye4gcWtlJq8zXhF.mp4"
}
]
}
}
]
},
So, you need to access extended_entities->media->video_info->variants to see all the different sizes and formats of video available.
You can choose between different sizes of MP4, a WEBM, and a stream - depending on what is suitable for the device you're playing back on.
(Taken from https://shkspr.mobi/blog/2015/02/working-with-the-twitter-videos-api/ )

Categories

Resources