flutter_fling 2.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 50

flutter_fling #

Simple plugin to cast media to FireStick and FireTv.

Utilises Amazon's Fling SDK.

NOTE: This plugin currently fling/cast from Android Devices. iOS support soon.

Installation #

Add package to pubspec.yaml #

flutter_fling: ^2.0.2

Add import #

import 'package:flutter_fling/flutter_fling.dart';

Usage #

Get Players #

FlutterFling.startPlayerDiscovery((status, player) {
	if (_flingDevices ==  null) _flingDevices =  List();
	if (status ==  PlayerDiscoveryStatus.FOUND) 
		_flingDevices.add(player);
	else 
		_flingDevices.remove(player);
});
  • Note: set callback as null to remove listener. You should clean up callback to prevent from leaking references.

Play media and listen for media state #

FlutterFling.play((state, condition, position) {
		_mediaState =  '$state';
		_mediaCondition =  '$condition';
		_mediaPosition =  '$position';
	},
	player: _selectedPlayer,
	mediaUri: "media_link_here",
	mediaTitle:  "Some Video",
)
  • Note: set callback as null to remove listener. You should clean up callback to prevent from leaking references.

Pause Player #

await FlutterFling.pausePlayer();

Resume Player #

await FlutterFling.playPlayer();

Stop Player #

await FlutterFling.stopPlayer();

Seek Forward Player (+10 sec) #

await FlutterFling.seekForwardPlayer();

Seek Back Player (-10 sec) #

await FlutterFling.seekBackPlayer();

Seek To Player #

await FlutterFling.seekToPlayer(position: 30000)

Mute/Unmute Player #

await FlutterFling.mutePlayer(bool);

Remove Controller when done #

Note: This result in loss of control over playing media though playback itself isn't stopped. Required for cleanup.

await FlutterFling.stopDiscoveryController();

Possible States: #

enum  PlayerDiscoveryStatus { Found, Lost }

enum  MediaState { NoSource, PreparingMedia, ReadyToPlay, Playing, Paused, Seeking, Finished, Error }

enum  MediaCondition { Good, WarningContent, WarningBandwidth, ErrorContent, ErrorChannel, ErrorUnknown }

2.0.2 #

  • Fix freeze on re-casting media

2.0.1 #

  • Added seek to position. Code optimised for better cleanup.

2.0.0 #

  • [Breaking Change] Code optimized: Callbacks for Discovery and Media State

1.0.1 #

  • Removed unnecessary logging.

1.0.0 #

  • Initial release.

example/README.md

flutter_fling_example #

Demonstrates how to use the flutter_fling plugin.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_fling: ^2.0.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_fling/flutter_fling.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

We analyzed this package on Dec 13, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Health issues and suggestions

Document public APIs. (-1 points)

47 out of 47 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test