vdocipher_flutter 2.7.7 copy "vdocipher_flutter: ^2.7.7" to clipboard
vdocipher_flutter: ^2.7.7 copied to clipboard

A VdoCipher plugin for flutter apps. This Plugin will help to serve content on supported platform app with Hollywood grade security to prevent video piracy.

VdoCipher plugin for flutter apps. #

pub package GitHub Sample

This Flutter plugin package enables video playback functionality by seamlessly delegating to native libraries tailored for each platform.

Platform Minimum Version
Android API level 21
iOS 12
Web Chrome, Firefox, Safari, Edge

Getting started #

Run this command with Flutter:

$ flutter pub add vdocipher_flutter
copied to clipboard

This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):

dependencies:
  vdocipher_flutter: ^2.7.7
copied to clipboard

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

To import it in your Dart code now, you can use:

import 'package:vdocipher_flutter/vdocipher_flutter.dart';
copied to clipboard

Note For SDK v2.2.0 and above, please use Theme.AppCompat theme with MainActivity.java and extend from FlutterFragmentActivity. For a better understanding, please take a look at our sample app.

Configuring VdoCipher Player #


//Creating embedInfo.
const EmbedInfo SAMPLE_1 = EmbedInfo.streaming(
    otp: '20160313versASE323nOHtQDX5BrcPQRzuzglCjLxHbd1JkvBFvBcPF68ysWD8HN',
    playbackInfo: 'eyJ2aWRlb0lkIjoiNWRlMDlmMGRjYmQ3NGI0NDljOWI1ZjRmYzBmMzI3ZmYifQ==',
    embedInfoOptions: EmbedInfoOptions(
        autoplay: true,
        customPlayerId: "4OEwYIsGO64aBwRp"
    )
);
copied to clipboard
class VdoPlaybackView extends StatefulWidget {

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

class _VdoPlaybackViewState extends State<VdoPlaybackView> {
  VdoPlayerController? _controller;
  final double aspectRatio = 16/9;
  ValueNotifier<bool> _isFullScreen = ValueNotifier(false);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
            body: VdoPlayer(
              embedInfo: embedInfo,
              onPlayerCreated: (controller) => _onPlayerCreated(controller),
              onFullscreenChange: (isFullscreen) {},
              onError: (vdoError) {},
            ));
  }

  _onPlayerCreated(VdoPlayerController? controller) {
    setState(() {
      _controller = controller;
      _onEventChange(_controller);
    });
  }

  _onEventChange(VdoPlayerController? controller) {
    controller!.addListener(() {
      VdoPlayerValue value = controller.value;

      print("VdoControllerListner"
          "\nloading: ${value.isLoading} "
          "\nplaying: ${value.isPlaying} "
          "\nbuffering: ${value.isBuffering} "
          "\nended: ${value.isEnded}"
      );
    });
  }

  double _getHeightForWidth(double width) {
    return width / aspectRatio;
  }
}
copied to clipboard

Playback Control Methods #

Play

Start or resume playing the video.

   _controller?.play()
copied to clipboard

Pause

Pause video playback.

   _controller?.pause()
copied to clipboard

Seek

Seek to the specified target position.

   Duration target = Duration(seconds: 30);
   _controller?.seek(target);
copied to clipboard

Total Played And Total Covered

Returns values of additional properties specific to current playback session. Returned values need to be cast to their expected types before use.

    int? totalPlayed = (await _controller?.getPlaybackProperty('totalPlayed')) as int?;
    int? totalCovered = (await _controller?.getPlaybackProperty('totalCovered')) as int?;
copied to clipboard

Buffered Position

Returns an estimate of the position up to which data is buffered.

    Future<Duration>? bufferedPosition = _controller?.getBufferedPosition();
copied to clipboard

Media Duration

Returns the total duration of the video.

    Future<Duration>? duration = _controller?.getDuration();
copied to clipboard

Playback Position

Returns the current playback position.

    Future<Duration>? position = _controller?.getPosition();
copied to clipboard

Please find more APIs here

25
likes
140
points
1.91k
downloads

Publisher

verified publishervdocipher.com

Weekly Downloads

2024.09.09 - 2025.03.24

A VdoCipher plugin for flutter apps. This Plugin will help to serve content on supported platform app with Hollywood grade security to prevent video piracy.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_web_plugins, js, plugin_platform_interface

More

Packages that depend on vdocipher_flutter