flutterexodrm 0.0.5

  • Readme
  • Changelog
  • Example
  • Installing
  • new55

FlutterPluginTest #

0.0.1 #

  • It was just attempt for making a plugin

0.0.2 #

  • I have added the Installation instructions to implement the plugins

0.0.3 #

  • HLS is currently Supported
  • Multi-Drm is not currently Supported (Still working on)

0.0.4 #

  • Offline licence helper supported
  • Multi-Drm is currently supported
  • Playlist is currently supported

0.0.5 #

  • test

example/lib/main.dart

import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:drm_wv_fp_player_example/PlayerPage.dart';
import 'model/media.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final appTitle = 'Flutter Exoplayer (Beta)';

    return MaterialApp(
      title: appTitle,
      debugShowCheckedModeBanner: false,
      home: MyHomePage(title: appTitle),
    );
  }
}

class MyHomePage extends StatefulWidget {
  final String title;

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

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

class _MyHomePageState extends State<MyHomePage> {
  bool dataReturned;
  List<Media> media;

  Future<List<Media>> loadMediaFiles() async {
    String jsonString =
        await rootBundle.loadString('assets/media.exolist.json');
    setState(() {
      dataReturned = true;
      media = Media.parseMediaLists(jsonString);
    });
    return Media.parseMediaLists(jsonString);
  }

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    dataReturned = false;
    media = new List();
    loadMediaFiles();
  }

  @override
  Widget build(BuildContext context) {
    SystemChrome.setPreferredOrientations([
      DeviceOrientation.portraitUp,
    ]);

    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: !dataReturned
          ? /* FutureBuilder<List<Media>>(
        future: loadMediaFiles(),
        builder: (context, snapshot) {
          if (snapshot.hasError) print(snapshot.error);
          return snapshot.hasData
              ? PhotosList(medias: snapshot.data)
              : Center(child: CircularProgressIndicator());
        },
      )*/
          Container()
          : PhotosList(medias: media),
    );
  }
}

class PhotosList extends StatelessWidget {
  final List<Media> medias;

  PhotosList({Key key, this.medias}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ListView.builder(
      itemCount: medias.length,
      itemBuilder: (context, index) {
        return StuffInTiles(medias[index], index, medias);
      },
    );
  }
}

class StuffInTiles extends StatefulWidget {
  final Media myTile;
  final List<Media> medias;
  final int index;
  BuildContext _context;

  StuffInTiles(this.myTile, this.index, this.medias);

  @override
  _StuffInTilesState createState() => _StuffInTilesState();
}

class _StuffInTilesState extends State<StuffInTiles> {
  Sample returnSample;
  Widget _buildSubTiles(Sample t) {
    return ListTile(
        dense: true,
        enabled: true,
        isThreeLine: false,
        onLongPress: () => print("long press"),
        onTap: () async {
          print("url ${t.uri ?? ""}");
          print("url ${t.drm_license_url ?? ""}");
          print("url ${t.playedLength ?? ""}");
          Sample result = await Navigator.push(
              widget._context,
              MaterialPageRoute(
                  builder: (_) =>
                      Player(
                        sampleVideo: returnSample != null ? returnSample.name == t.name ? returnSample : t : t,
                      )));
          if (result != null) {
//            SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
            print("back from player");
            setState(() {
              returnSample = result;
              print(t.playedLength);
              SystemChrome.setPreferredOrientations([
                DeviceOrientation.portraitUp,
              ]);
            });
          }
        },
        subtitle: Text(
          t.extension ?? "",
        ),
        selected: true,
        title: Text(t.name,
            style: TextStyle(fontSize: 18.0, color: Colors.black54)));
  }

  Widget _buildTiles(Media t) {
    return ExpansionTile(
      key: PageStorageKey<int>(3),
      title: Text(t.name),
      children: t.samples.map(_buildSubTiles).toList(),
    );
  }

  @override
  Widget build(BuildContext context) {
    widget._context = context;
    return _buildTiles(widget.myTile);
  }
}

//ChewieDemo(sampleVideo: t,)

Use this package as a library

1. Depend on it

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


dependencies:
  flutterexodrm: ^0.0.5

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:flutterexodrm/drm_wv_fp_player_test.dart';
import 'package:flutterexodrm/model/secured_video_content.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
32
Health:
Code health derived from static analysis. [more]
96
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
50
Overall:
Weighted score of the above. [more]
55
Learn more about scoring.

We analyzed this package on Jul 11, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.15
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform Linux

Because:

  • package:flutterexodrm/drm_wv_fp_player_test.dart that declares support for platforms: Android, iOS

Package does not support Flutter platform Web

Because:

  • package:flutterexodrm/drm_wv_fp_player_test.dart that declares support for platforms: Android, iOS

Package does not support Flutter platform Windows

Because:

  • package:flutterexodrm/drm_wv_fp_player_test.dart that declares support for platforms: Android, iOS

Package does not support Flutter platform macOS

Because:

  • package:flutterexodrm/drm_wv_fp_player_test.dart that declares support for platforms: Android, iOS

Package not compatible with SDK dart

Because:

  • flutterexodrm that is a package requiring null.

Health suggestions

Fix lib/model/secured_video_content.dart. (-3.93 points)

Analysis of lib/model/secured_video_content.dart reported 8 hints, including:

line 7 col 16: Name non-constant identifiers using lowerCamelCase.

line 8 col 16: Name non-constant identifiers using lowerCamelCase.

line 9 col 16: Name non-constant identifiers using lowerCamelCase.

line 11 col 16: Name non-constant identifiers using lowerCamelCase.

line 18 col 12: Name non-constant identifiers using lowerCamelCase.

Format lib/drm_wv_fp_player_test.dart.

Run flutter format to format lib/drm_wv_fp_player_test.dart.

Maintenance issues and suggestions

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field https://github.com/sammymutahigicheru/FlutterPluginTest.git was unreachable.

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
flutter 0.0.0
http ^0.12.0+2 0.12.1
meta ^1.1.8 1.1.8 1.2.2
Transitive dependencies
charcode 1.1.3
collection 1.14.12 1.14.13
http_parser 3.1.4
path 1.7.0
pedantic 1.9.0 1.9.2
sky_engine 0.0.99
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6 1.2.0
vector_math 2.0.8 2.1.0-nullsafety
Dev dependencies
flutter_test