All Projects → rodydavis → Media_picker

rodydavis / Media_picker

Licence: other
A Flutter Plugin for Selecting and Taking New Photos and Videos.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Media picker

Focus Points
Plugin for Lightroom to show which focus point was active in the camera when a photo was taken
Stars: ✭ 272 (+1033.33%)
Mutual labels:  camera, iphone, photos
PhotosApp
React Native Photos App: AWS Amplify, AWS S3, Mobile Analytics with Pinpoint
Stars: ✭ 21 (-12.5%)
Mutual labels:  photos, camera
TumblTwo
TumblTwo, an Improved Fork of TumblOne, a Tumblr Downloader.
Stars: ✭ 57 (+137.5%)
Mutual labels:  photos, videos
MCamera
CameraViewController which allows to take photos, set filters, peform image blurring and more.
Stars: ✭ 28 (+16.67%)
Mutual labels:  photos, camera
flutter scan
scanner qrcode in widget tree & decoder qrcode from image
Stars: ✭ 63 (+162.5%)
Mutual labels:  camera, flutter-plugin
Lassi-Android
All in 1 picker library for android.
Stars: ✭ 108 (+350%)
Mutual labels:  camera, videos
QuickRawPicker
📷 QuickRawPicker is a free and open source program that lets you cull, pick or rate raw photos captured by your camera. It is also compatible with the XMP sidecar file used by Adobe Bridge/Lightroom/Darktable or PP3 sidecar file used by Rawtherapee.
Stars: ✭ 26 (+8.33%)
Mutual labels:  photos, camera
Android Multipicker Library
Android Multipicker Library
Stars: ✭ 425 (+1670.83%)
Mutual labels:  photos, videos
Magicalcamera
A library to take picture easy, transform your data in different format and save photos in your device
Stars: ✭ 327 (+1262.5%)
Mutual labels:  camera, photos
Stickercamera
This is an Android application with camera,picture cropping,collage sticking and tagging.贴纸标签相机,功能:拍照,相片裁剪,给图片贴贴纸,打标签。
Stars: ✭ 3,109 (+12854.17%)
Mutual labels:  camera, photos
TuSDK-for-Android-demo
TuSDK Android 图像 SDK Demo
Stars: ✭ 93 (+287.5%)
Mutual labels:  photos, camera
Simple Camera
Quick photo and video camera with a flash, customizable resolution and no ads.
Stars: ✭ 503 (+1995.83%)
Mutual labels:  camera, photos
Chafu
A photo browser and camera library for Xamarin.iOS
Stars: ✭ 36 (+50%)
Mutual labels:  photos, camera
CameraSlider
3D printed and smartphone controlled camera slider
Stars: ✭ 16 (-33.33%)
Mutual labels:  photos, camera
exiftool-json-db
Maintain a JSON database of photos and videos with their metadata
Stars: ✭ 18 (-25%)
Mutual labels:  photos, videos
photos
"Fx Fotos" is an opensource gallery app in react native with the same smoothness and features of Google Photos and Apple Photos. It is backend gnostic and connects to decentralized backends like "box", "Dfinity", "Filecoin" and "Crust".
Stars: ✭ 620 (+2483.33%)
Mutual labels:  photos, videos
Agimagecontrols
cool tools for image edition
Stars: ✭ 217 (+804.17%)
Mutual labels:  camera, photos
viewer
🖼 Simple file viewer with slideshow for media
Stars: ✭ 68 (+183.33%)
Mutual labels:  photos, videos
Android Camera2 Secret Picture Taker
Take pictures 📷 secretly (without preview or launching device's camera app) using Android CAMERA2 API
Stars: ✭ 275 (+1045.83%)
Mutual labels:  camera, photos
Rxpaparazzo
RxJava extension for Android to take images using camera and gallery and pick files up
Stars: ✭ 467 (+1845.83%)
Mutual labels:  camera, photos

media_picker

alt text

Description

Flutter Plugin for Capturing and Selecting Photos and Videos.

Installing

media_picker:
    git:
      url: git://github.com/AppleEducate/media_picker

Import

import 'package:media_picker/media_picker.dart';

Example


import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:media_picker/media_picker.dart';
import 'package:video_player/video_player.dart';

void main() {
  runApp(new MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Media Picker Demo',
      home: new MyHomePage(title: 'Media Picker Example'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  Future<File> _mediaFile;
  bool isVideo = false;
  VideoPlayerController _controller;
  VoidCallback listener;

  void _onImageButtonPressed(ImageSource source) {
    setState(() {
      if (_controller != null) {
        _controller.setVolume(0.0);
        _controller.removeListener(listener);
      }
      if (isVideo) {
        _mediaFile = MediaPicker.pickVideo(source: source).then((onValue) {
          _controller = VideoPlayerController.file(onValue)
            ..addListener(listener)
            ..setVolume(1.0)
            ..initialize()
            ..setLooping(true)
            ..play();
          setState(() {});
        });
      } else {
        _mediaFile = MediaPicker.pickImage(source: source);
      }
    });
  }

  @override
  void deactivate() {
    _controller.setVolume(0.0);
    _controller.removeListener(listener);
    super.deactivate();
  }

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  @override
  void initState() {
    super.initState();
    listener = () {
      setState(() {});
    };
  }

  @override
  Widget build(BuildContext context) {
    Widget _previewImage = new FutureBuilder<File>(
      future: _mediaFile,
      builder: (BuildContext context, AsyncSnapshot<File> snapshot) {
        if (snapshot.connectionState == ConnectionState.done &&
            snapshot.data != null) {
          return new Image.file(snapshot.data);
        } else if (snapshot.error != null) {
          return const Text('Error picking image.');
        } else {
          return const Text('You have not yet picked an image.');
        }
      },
    );

    return new Scaffold(
      appBar: new AppBar(
        title: const Text('Media Picker Example'),
      ),
      body: new Center(
        child: isVideo
            ? new Padding(
                padding: const EdgeInsets.all(10.0),
                child: new AspectRatio(
                  aspectRatio: 1280 / 720,
                  child: (_controller != null
                      ? VideoPlayer(
                          _controller,
                        )
                      : Container()),
                ),
              )
            : _previewImage,
      ),
      floatingActionButton: new Column(
        mainAxisAlignment: MainAxisAlignment.end,
        children: <Widget>[
          new FloatingActionButton(
            onPressed: () {
              isVideo = false;
              _onImageButtonPressed(ImageSource.gallery);
            },
            tooltip: 'Pick Image from gallery',
            child: const Icon(Icons.photo_library),
          ),
          new Padding(
            padding: const EdgeInsets.only(top: 16.0),
            child: new FloatingActionButton(
              onPressed: () {
                isVideo = false;
                _onImageButtonPressed(ImageSource.camera);
              },
              tooltip: 'Take a Photo',
              child: const Icon(Icons.camera_alt),
            ),
          ),
          new Padding(
            padding: const EdgeInsets.only(top: 16.0),
            child: new FloatingActionButton(
              backgroundColor: Colors.red,
              onPressed: () {
                isVideo = true;
                _onImageButtonPressed(ImageSource.gallery);
              },
              tooltip: 'Pick Video from gallery',
              child: const Icon(Icons.video_library),
            ),
          ),
          new Padding(
            padding: const EdgeInsets.only(top: 16.0),
            child: new FloatingActionButton(
              backgroundColor: Colors.red,
              onPressed: () {
                isVideo = true;
                _onImageButtonPressed(ImageSource.camera);
              },
              tooltip: 'Take a Video',
              child: const Icon(Icons.videocam),
            ),
          ),
        ],
      ),
    );
  }
}


Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].