Android: How to determine a given url is video link or a webpage - android-webview

How to determine that a given link is video or a weblink...as all link dont have extension as .mp4 or .3gp etc....viz
http://www.youtube.com/results?search_query=comedy&aq=f (is a weblink)
[http://www.youtube.com/watch?v=vt4X7zFfv4k][1] (is a video link)
In order to call respective view as video or webview...

The only way to be sure is to get the head of the url, follow all redirects and check the mimetype of the response.

Related

How to download video from tiktok url by flutter?

I would like to download video from tiktok url by flutter.
I was able to extract only video url from tiktok video url.
Like this
https://v16-webapp.tiktok.com/16301adb3bdaee90952c0a29ba9aa269/6280a48d/video/tos/alisg/tos-alisg-pve-0037/4513bbabd77948d0ad68ea9154d3c580/?a=1988&br=700&bt=350&cd=0%7C0%7C1%7C0&ch=0&cr=0&cs=0&cv=1&dr=0&ds=3&er=&ft=eXd.6HVJMyq8Zjhdlwe2NZZK2l7Gb&l=202205150054570102440750600FBBD34F&lr=tiktok_m&mime_type=video_mp4&net=0&pl=0&qs=0&rc=M2V2ZjQ6ZnZ3PDMzODgzNEApMzdlOWQ3OTtkNzQ7ZTxkZmdzbTBocjRvYHNgLS1kLy1zczI2YDVeNWFgMWIyLmJjYTI6Yw%3D%3D&vl=&vr=
However, the last of this url is not ".mp4" and I can find only how to download video from ".mp4 link" on the web.
Please teach me how to download video from "not mp4" video link to my iphone by flutter!
"This Answer seems to suggest reading the video into a bytes Array then write those bytes as a file in storage. You create a File object with your preferred filename (eg: in code the $filename becomes "test.mp4"). –
VC.One
May 15 at 12:26"
This is an Answer!!
Thank you!
you can do inspect element and then go to network tab and then go to media tab. After that click on the video on tiktok website whose mp4 you want, and it will appear in the media tab . You can go to that url which will be a cdn and download it from there.

How to add thumbnail to facebook scheduled LIVE VIDEO using API

I want to add thumbnail to facebook LIVE VIDEO using graph api. I saw some websites able to do that , they can add thumbnail to live video. there is no docs available to do that.
I tried to upload thumbnail to the live video attachment but not worked.
some website are able to add the thumbnail to the scheduled live video , see the above screenshot with thumbnail
As far as I know, there's no standard way of doing that. However, if you tried getting the data of the live video after the live stream has started, it will include an iframe that has the video ID in its source. So the process would be something like this:
Create the live video
Start the live stream
Get the live video data
Parse the iframe content and extract the value from the src attribute
Get the href query param from the extracted value
The last part of the href is the actual video ID that will show in feeds
Use that video ID to add the thumbnail
I would advise adding some latency before step #3 so that you can be sure that the video has been created in feeds.
USE THIS
https://developers.facebook.com/docs/graph-api/reference/live-video/#Creating
Include event_params: {"cover" : "<thumbnail url>"} in the request parameters
Cover photo won't show up in timeline. (You need to click on more and then click on events)

can you load videos in flutter through an api?

I found this article to upload videos but it already has the urls of the videos written.
I need to pass the videos through an api.
Any ideas??
https://medium.com/#sanjeevmadhav03/preloading-videos-in-flutter-4b65cf0681c6
Check if your api endpoint Supports upload of binary files. If it does, check if you're given url of the location of the video

Video player with YouTube video link for flutter app

I have a question about Video playing. Can I use video_player (without using another package) for YouTube videos. If so, how? When I set the video URL, the console is showing me the following error :
Unhandled Exception: PlatformException(VideoError, Failed to load video: Operation Stopped, null, null)
Thanks for your attention :)
I do not think you can play Youtube videos via URL with this package. Seems like you need an URL of the video file (you could notice that in the documentation, where the URL is a specific place in the server, e.g. https://www.sample-videos.com/video123/mp4/720/big_buck_bunny_720p_20mb.mp4). Meaning, you need access to the video file and not a video URL on Youtube.

how to upload video to youtube from an URL

in my app i want to upload an video to youtube. The video is already been placed in another database of an URL. How to upload the video from that url to youtube......
YouTube does not provide an API to upload videos from a URL. You would first have to download the video to your device. Once you have video, the actual file, you can upload the video to YouTube using their API.
You would have use NSURLConnection and or NSURLRequest to upload the video.
Browser-based uploading
You can use the code in this test application and just change the path of the file from nsString to nsUrl.
But you have to use the new version of http://code.google.com/p/gdata-objectivec-client/
Here is a good tutorial. It works like charm. I can now upload video both from the device and an URL.