https://github.com/ponnamkarthik/drm_video
DRM Player for Flutter
https://github.com/ponnamkarthik/drm_video
Last synced: 3 months ago
JSON representation
DRM Player for Flutter
- Host: GitHub
- URL: https://github.com/ponnamkarthik/drm_video
- Owner: ponnamkarthik
- License: mit
- Created: 2020-11-18T01:39:22.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-18T01:50:16.000Z (almost 5 years ago)
- Last Synced: 2025-04-09T20:05:20.124Z (6 months ago)
- Language: Dart
- Size: 78.1 KB
- Stars: 16
- Watchers: 2
- Forks: 10
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# [drm_video](https://pub.dartlang.org/packages/drm_video)
### Video Player for DRM and non DRM content with every functionality provided official video_player
[](https://pub.dartlang.org/packages/drm_video)
# NOTICE
> This Plugin uses some code from [video_player](https://pub.dartlang.org/packages/video_player) plugins which is the official video_player plugin
## Installation
First, add `drm_video` as a [dependency in your pubspec.yaml file](https://flutter.io/using-packages/).
### iOS
Warning: The video player is not functional on iOS simulators. An iOS device must be used during development/testing.
Add the following entry to your _Info.plist_ file, located in `/ios/Runner/Info.plist`:
```xml
NSAppTransportSecurityNSAllowsArbitraryLoads
```
This entry allows your app to access video files by URL.
### Android
Ensure the following permission is present in your Android Manifest file, located in `/android/app/src/main/AndroidManifest.xml`:
```xml
```
## Example
```dart
import 'package:flutter/material.dart';
import 'package:drm_video/drm_video.dart';
import 'package:drm_video/video_controller.dart';void main() {
runApp(MyApp());
}class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}class _MyAppState extends State {
VideoController _videoController;
String dashUrl = "https://storage.googleapis.com/wvmedia/cenc/h264/tears/tears.mpd";
String licenseUrl = "https://proxy.staging.widevine.com/proxy";@override
void dispose() {
_videoController.dispose();
super.dispose();
}@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
floatingActionButton: FloatingActionButton(
onPressed: () {
setState(() {
_videoController.value.isPlaying
? _videoController.pause()
: _videoController.play();
});
},
child: Icon(
( _videoController?.value?.isPlaying ?? false)? Icons.pause : Icons.play_arrow,
),
),
body: Center(
child: Column(
children: [
AspectRatio(
aspectRatio: _videoController?.value?.aspectRatio ?? 16 / 9,
child: Stack(
alignment: Alignment.bottomCenter,
children: [
Container(
child: DrmVideoPlayer(
videoUrl: dashUrl,
autoPlay: false,
drmLicenseUrl: licenseUrl,
onVideoControls: (VideoController controller) {
print("onVideoControls $controller");
_videoController = controller;
_videoController.addListener(() {
setState(() {});
});
setState(() {});
},
),
),
],
),
),
],
),
),
),
);
}
}
```## Working On
- DRM Support for iOS
- RTMP Support for Android> For more code please check example project
## Buy Me a Coffee