video_player_oneplusdream 0.0.1+8
video_player_oneplusdream: ^0.0.1+8 copied to clipboard
this plugin used for video player in ios, android, web with many functions.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:video_player_oneplusdream/video_player_oneplusdream.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
String _platformVersion = 'Unknown';
VideoPlayerController? controller1;
VideoPlayerController? controller2;
@override
void initState() {
super.initState();
}
// Platform messages are asynchronous, so we initialize in an async method.
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: SafeArea(
child: SingleChildScrollView(
child: Column(
children: [
Text("hello world"),
SizedBox(
height: 200,
child: VideoPlayerOnePlusDream([
PlayingItem(
"https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8",
title: "Rabbit"),
PlayingItem(
"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8",
title: "BigBop"),
],
enableMarquee: true,
enablePreventScreenCapture: true,
marqueeText: "Hello",
autoPlay: false,
onBack: () => print("onBack1"),
onPlaying: (event) {
print("onPlaying event happened $event");
},
onVideoCreated: ((controller) =>
controller1 = controller)),
),
Text("Second"),
SizedBox(
height: 300,
child: VideoPlayerOnePlusDream(
[
PlayingItem(
"https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8",
title: "Rabbit"),
PlayingItem(
"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8",
title: "BigBop"),
],
enableMarquee: true,
enablePreventScreenCapture: true,
marqueeText: "What",
autoPlay: false,
onBack: () => print("onBack2"),
onPlaying: (event) {
print("onPlyaing happened");
print(event);
},
onVideoCreated: ((controller) =>
controller2 = controller),
),
),
ElevatedButton(
onPressed: () {
controller1?.toggleFullScreen(
ToggleFullScreenParam(isFullScreen: true));
},
child: Text("open full screen")),
ElevatedButton(
onPressed: () {
controller1?.play(PlayingItem(
"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8",
title: "Hello world"));
},
child: Text("play another item"))
],
),
),
),
),
),
);
}
}