gpu_video_plugin

Last updated:

0 purchases

gpu_video_plugin Image
gpu_video_plugin Images
Add to Cart

Description:

gpu video plugin

GPU Video Plugin for Flutter #
A Flutter plugin for Android to handle filter from gallery, camera and video url.
Android
copied to clipboard
Support SDK 21+
Using #
import
import 'package:gpu_video_plugin/gpu_video.dart';

copied to clipboard
Use video Device #
Get the list of videos on the device
List<VideoItem> list = await VideoLoader.videosLoaders;

copied to clipboard
Get the list of supported filters
List<String> listFilter = await Filters.filters;

copied to clipboard
Start processing filter video
Filters.startCodec(videoPath, filter, isMute, isFlipHorizontal, isFlipVertical);

copied to clipboard
Play video
VideoLoader.playMovie(videoPath);

copied to clipboard
Display video filter processing
double valueProcessFilter = 0;
ProcessFilter(
onProgress: (val) {
setState(() {
valueProcessFilter = val;
});
},
onCompleted: (val) {
if (val == true) {
valueProcessFilter = 0.0;
loadListVideo();
}
},
child: LinearProgressIndicator(
value: valueProcessFilter,
semanticsLabel: 'Linear progress indicator',
),
),
copied to clipboard
Use video Camera Device #
In order to use the camera, you must first apply for permission
if (await Camera.checkPermissionCamera()) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const Cameraaaa()),
);
}

copied to clipboard
Camera display
isLoadingCamera
? const Center(child: CircularProgressIndicator())
: Camera(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
),

copied to clipboard
Set Filter
Camera.setFilter(nameFilter);

copied to clipboard
Change Camera
switchCamera() async {
setState(() {
isLoadingCamera = true;
});
await Camera.switchCamera();
setState(() {
isLoadingCamera = false;
});
}

copied to clipboard
User FLASH
Camera.flash();

copied to clipboard
ImageCapture
Camera.imageCapture();

copied to clipboard
Record video
if (!isRecord) {
Camera.startRecord();
} else {
Camera.stopRecord();
}
setState(() {
isRecord = !isRecord;
});

copied to clipboard
Use video url #
Show video
MovieView(url: url, height: 300),

copied to clipboard
Interactions with videos
Expanded(
child: ListView.separated(
itemBuilder: (_, index) => InkWell(
onTap: () async {
if (await MovieView.setFilterMovie(
_listFilter[index])) {
setState(() {
isChangeValueFilter = true;
});
} else {
setState(() {
isChangeValueFilter = false;
});
}
},
child: Text(_listFilter[index])),
separatorBuilder: (_, index) => const SizedBox(
height: 20,
),
itemCount: _listFilter.length)),
Visibility(
visible: isChangeValueFilter,
child: Row(
children: [
const Text("Filter"),
const SizedBox(
width: 10,
),
Expanded(
child: Slider(
max: 100,
value: valueFilter,
onChanged: (double value) {
setState(() {
valueFilter = value;
MovieView.changeValueFilter(valueFilter.toInt());
});
},
),
),
],
),
),
Row(
children: [
const Text("Time"),
const SizedBox(
width: 10,
),
Expanded(
child: ProcessMovieView(
onDuration: (dura) {
if (duration != dura) {
setState(() {
duration = dura;
});
}
},
onCurrentPosition: (currentPos) {
print("currentPosASSSS:" + currentPos.toString());
setState(() {
currentPosition = currentPos;
});
},
child: Slider(
max: duration.toDouble(),
value: currentPosition.toDouble(),
onChanged: (double value) {
setState(() {
currentPosition = value.toInt();
MovieView.seekToMovie(value.toInt());
});
},
),
),
),
],
),

copied to clipboard
Play video
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.blue,
),
onPressed: () {
setState(() {
if (isPlay) {
MovieView.pause();
} else {
MovieView.play();
}
isPlay = !isPlay;
});
},
child: Text(
isPlay ? "Pause" : "Play",
style: const TextStyle(
color: Colors.white,
),
),
),

copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.