Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[video_player] Playing video using Byte data (uint8list) #59387

Closed
markgrancapal opened this issue Jun 13, 2020 · 14 comments
Closed

[video_player] Playing video using Byte data (uint8list) #59387

markgrancapal opened this issue Jun 13, 2020 · 14 comments
Labels
c: new feature Nothing broken; request for a new capability p: video_player The Video Player plugin P3 Issues that are less important to the Flutter project package flutter/packages repository. See also p: labels.

Comments

@markgrancapal
Copy link

I'm using flutter web, and I have an html.file that contains the video.

@VladyslavBondarenko VladyslavBondarenko added p: video_player The Video Player plugin plugin c: new feature Nothing broken; request for a new capability and removed created via support template labels Jun 15, 2020
@thedejifab
Copy link
Contributor

Any progress on this feature?

@mhbdev
Copy link
Contributor

mhbdev commented Oct 19, 2020

I just got the blob data out of html.File using html.FileReader and gave it to an html.VideoElement src but it is not working :( That works fine in a simple html file. I tried to give blob string to VideoController.network dataSource but it does not work either.

<html>
<body>
<video src="data:application/octet-stream................"></video>
</body>
</html>

Can anybody explain how to load Uin8List or blob data to a simple video player! (Web)

Update:
Convert your Uint8List to blob data then use VideoPlayerController.network to load blob string to VideoElement src. (This works fine for video_player_web)
You can also upload your videos then use the upload url to load the video from the internet.

@AlaaEldeenYsr
Copy link

How can i do this in flutter mobile ?

@mikron123
Copy link

I just got the blob data out of html.File using html.FileReader and gave it to an html.VideoElement src but it is not working :( That works fine in a simple html file. I tried to give blob string to VideoController.network dataSource but it does not work either.

<html>
<body>
<video src="data:application/octet-stream................"></video>
</body>
</html>

Can anybody explain how to load Uin8List or blob data to a simple video player! (Web)

Update:
Convert your Uint8List to blob data then use VideoPlayerController.network to load blob string to VideoElement src. (This works fine for video_player_web)
You can also upload your videos then use the upload url to load the video from the internet.

How did you convert the Uint8List to Blob data?

@AlaaEldeenYsr
Copy link

Any updates in this feature

@devanflores
Copy link

Hey @mhbdev could you give us a little bit of code to show how to do this? I'm definitely stuck

@yaizudamashii
Copy link

@devanflores
https://stackoverflow.com/questions/65821003/flutter-web-playing-uint8list-n-videoplayer/65834130

@krish-bhanushali
Copy link

krish-bhanushali commented Mar 10, 2021

I tried doing this, uploaded video file in web using file picker. I got the bytes in Uintlist and converted into blob and passed it into video controller. Although problem I am facing is it only plays audio somehow when format is mkv. Can anyone suggest a way to solve this?

@stuartmorgan stuartmorgan added the P3 Issues that are less important to the Flutter project label May 23, 2021
@laxkarparas1
Copy link

https://stackoverflow.com/questions/65821003/flutter-web-playing-uint8list-n-videoplayer/65834130

this is not working in my case

final blob = html.Blob([decryptedBytes]);
url = await html.Url.createObjectUrlFromBlob(blob);

 it throws this error
 
 [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: UnimplementedError

E/flutter (30797): #0 Url.createObjectUrlFromBlob (package:universal_html/src/html/api/history.dart:175:5)
E/flutter (30797): #1 _MyHomePageState.decryptFile (package:flutter_screenshot/main.dart:214:27)
E/flutter (30797):
E/flutter (30797): #2 _MyHomePageState.perfomEncryptionTasks (package:flutter_screenshot/main.dart:147:5)
E/flutter (30797):

@laxkarparas1
Copy link

How can i do this in flutter mobile ?

did you find answer for this ......?

@ThanhDat-Vo
Copy link

@RobertApikyan
Copy link

Yes, but is there a solution for mobile ? Can we play Uint8List data using the video player ?

@stuartmorgan
Copy link
Contributor

Duplicate of #53017

@stuartmorgan stuartmorgan marked this as a duplicate of #53017 May 21, 2023
@stuartmorgan stuartmorgan closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2023
@github-actions
Copy link

github-actions bot commented Jun 4, 2023

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 4, 2023
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: new feature Nothing broken; request for a new capability p: video_player The Video Player plugin P3 Issues that are less important to the Flutter project package flutter/packages repository. See also p: labels.
Projects
None yet
Development

No branches or pull requests