How to add multiple youtube playlist with video in my flutter app? - flutter

I need to add Youtube playlist with Youtube player in my flutter application.And i want to add multiple playlist. When i will upload video to youtube then autometically will have to appears on my flutter app.
I saw some tutorial, where people use hereku server to fetch youtube api to flutter app. But they use just a single playlist. here is the link
Can you tell me how i can add multiple playlist on my app.
Thank You :)

I think you could maybe try a combination of this two packages:
youtube_api:
With this package you could fetch all the videos inside a playlist and (as it goes directly through Youtube API) the list should update as soon as a new video is uploaded.
youtube_player_flutter:
Given a certain list of youtube video ids, you can use this player to reproduce them (I’ve used it in a project and worked perfectly, even with live streams)
So, I guess that combining them would be my fist approach.
Update 31 Jan 20201
I tried youtube_api package but couldn't make it load the videos from a specific youtube playlistId neither, so I've checked their code and created a new implementation that only retrieves the videos from a specific playlistId.
Here is the code if you want to take a look https://github.com/rodrigoc85/flutter-load-youtube-playlist

Related

Using Youtube as video storage for my app

I am still relatively new to these topics.
I am programming my app in Flutter and I can already use Flutter to play a foreign video from Youtube in the app.
I want to upload in Youtube all my video resources as private to be able to display them in my app.
Is there any documentation on how to do this? What are the costs per request?
Is Youtube even right for such a mobile app?`
I was going to use Firebase cloud storage, but think that can get very expensive once I release the app.
What other options would I have?
This question isn't really suitable for StackOverflow, since it's basically just asking whether you can use YouTube.
That being said, as long as you don't violate the T&C of YouTube and you're fine with storing all your videos on their platform, yes, you can do this. Using YouTube this way is free as of now. But note that there is a difference between "private" and "unlisted".
You can create a profile on youtube, upload as many videos as you want and list them as unlisted, meaning you can only find the video if you have the link, then in your app link the vides to whatever selection method you have. so ex I have a button when clicked launches a specific unlisted youtube url link and plays the video.
It would be the same as if someone was searching your video publicly and playing it, both are free.

how to play youtube videos in flutter

I'm trying to play YouTube Videos in my Flutter Web Application, but with the default VideoPlayer you need the YouTube src path (...googlevideos.com/...), which I couldn't get right.
I did some google research and I found the following packages:
https://pub.dev/packages/youtube_player_flutter
https://pub.dev/packages/chewie
But both of them won't play direct YouTube links, and the first one isn't supported for Flutter-Web.
Does anyone have experience with this topic or knows how to get the YouTube source links (for example with an API) ?
Did you try this package: youtube_player_iframe: ^2.3.0
find it here https://pub.dev/packages/youtube_player_iframe
EDIT1: YouTube seems to shuffle the source video file url every day, so using the source file url is not a viable solution. Another option is to add the video to your project locally and add an overlay "YouTube" button on top of the video and when the user taps it he is taken to the video on YouTube. Downside to using asset video though is the fact that you are unable to adjust the progress bar (at least in version 2.4.5).
You can use the official video_player package and get the source file path to YouTube video file by using VLC media player by following these steps:
Find a video on YouTube and copy the URL from the address bar.
In VLC, head to Media > Open Network Stream.
Paste the YouTube link in the box and click Play.
Under Tools, click Codec Information.
In the box that says Location, right-click the block of text and click Select All. This is the url to your local video file.
These steps are almost a copy / paste found from here: How to obtain the direct link to a YouTube video file
You can also use the youtube_player_iframe package, but note that if you hover on top of the video when using that player, you are unable to scroll your content and there seems to be no workaround as discussed in here: Mouse scroll stuck while cursor is on top of youtube_player_iframe. That's the only reason why I decided to use the official video player package.

Custom youtube player in flutter

I use YouTube API for my app. I use youtube_player_flutte.Is there a way to customize a youtube player or maybe use another player + youtube API.
I am showing you what I don't like in youtube API.Is there a way to remove it.
If you API for YouTube , I don't think that's possible .
So i recommend search again in pub.dev, if not you can choose another way to show the videos

Flutter - Upload Video to Youtube

In my app I need the ability to take and upload or save a short 5 to 15 second video. I also need to be able to save the video if the user is offline, and upload it when connected to internet.
I can create the video file with the plugin image_picker, I tried to save it to the users gallery using plugin image_picker_saver but that seems to only handle images.
So I will probably have to use something like path_provider to save it to local storage (again examples of writing files are images as byte data)
When connected is there a way to upload a video to a Youtube account ?
I have read up on some Youtube plugins, but they are geared towards playing videos.
I was thinking of using WebViews to pop up the m.youtube.com/upload page but once you start an upload it goes to the desktop www.youtube.com
Other option to consider is using Firestore as the upload destination when they have a connection, but I would still have to manage offline local storage.
Thank you any help
Edit RE: comments below
Here is what I get when trying to capture a Landscape video on iPhone X with camera plugin:

Playing video from youtube link without UIWebView

I want to play a video in my app from youtube link e.g: http://www.youtube.com/watch?v=Uner-3tTY1I.
But i don't want to redirect the user to any web view in the app. Just want to play that video in the video player in the current view of my application.
Is it possible to play the video without redirecting to UIWebView? If possible, how can i do this? Thanks for the help in advance.
The only allowed way seems to be using UIWebview. Doing it other way will violate youtube copyrights.
However there are few open source libraries out there. You can use it at your own risk.
Just use XCDYouTubeVideoPlayerViewController. It uses progressive download + MoviePlayer and AVFoundation frameworks.
To play this video you need to have the link to the video stream that is associated with video you want to play. Unfortunately this isn't so simple to get this link for some movies on YouTube since this link can be encoded for some movies (channel VEVO for example). Read this for more information about encoded links http://www.jwz.org/blog/2013/06/youtube-download-counter-countermeasures-applied/.
Unfortunattely as for now there is no simple way to decode these links. Despite this, you can get the source link for the not encoded films without bigger problems using some calls to the YouTube Api.