ivs_player2 0.0.5 ivs_player2: ^0.0.5 copied to clipboard
Wrapper for Amazon IVS Android and iOS SDKs
example/lib/main.dart
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:ivs_player2/ivs_player2.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
final player = IvsPlayer2();
return MaterialApp(
home: SafeArea(
child: Scaffold(
appBar: AppBar(
title: const Text('IVS Player Example'),
),
body:
Stack(
children: [
Container(
color: Colors.amber,
child: player.player(
"https://fcc3ddae59ed.us-west-2.playback.live-video.net/api/video/v1/us-west-2.893648527354.channel.YtnrVcQbttF0.m3u8"),
),
Positioned(
top: 20,
child: ElevatedButton(
onPressed: () => player.caption(), child: const Text("字幕")),
),
Positioned(
top: 70,
child: ElevatedButton(
onPressed: () => player.muted(), child: const Text("音声")),
),
],
),
),
)
);
}
}