byteark_player_flutter 1.0.4
byteark_player_flutter: ^1.0.4 copied to clipboard
ByteArkPlayerFlutter is a Flutter plugin for the ByteArk Player, designed to enable seamless video playback and advanced player management within your Flutter applications.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:byteark_player_flutter/data/byteark_player_config.dart';
import 'package:byteark_player_flutter/data/byteark_player_item.dart';
import 'package:byteark_player_flutter/presentation/byteark_player.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
// Step 1: Set ByteArkPlayerItem.
var playerItem = ByteArkPlayerItem(
url:
"https://byteark-playertzxedwv.stream-playlist.byteark.com/streams/TZyZheqEJUwC/playlist.m3u8");
// Step 2: Set ByteArkPlayerConfig.
var playerConfig = ByteArkPlayerConfig(playerItem: playerItem);
return MaterialApp(
title: 'ByteArk Player Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: Scaffold(
appBar: AppBar(
title: const Text('ByteArk Player Demo'),
centerTitle: true,
),
body: Column(
children: [
// Step 3: Embed ByteArk Player widget.
AspectRatio(
aspectRatio: 16 / 9,
child: ByteArkPlayer(
playerConfig: playerConfig,
height: 300,
),
),
],
),
),
);
}
}