forked from oyd/ozgurkon-app
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
988 B
28 lines
988 B
import 'package:flutter/material.dart';
|
|
import 'package:video_viewer/video_viewer.dart';
|
|
|
|
class HLSVideoExample extends StatelessWidget {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return FutureBuilder<Map<String, VideoSource>>(
|
|
future: VideoSource.fromM3u8PlaylistUrl(
|
|
"https://sfux-ext.sfux.info/hls/chapter/105/1588724110/1588724110.m3u8",
|
|
formatter: (quality) =>
|
|
quality == "Auto" ? "Automatic" : "${quality.split("x").last}p",
|
|
),
|
|
builder: (_, data) {
|
|
return data.hasData
|
|
? VideoViewer(
|
|
source: data.data,
|
|
onFullscreenFixLandscape: true,
|
|
style: VideoViewerStyle(
|
|
thumbnail: Image.network(
|
|
"https://play-lh.googleusercontent.com/aA2iky4PH0REWCcPs9Qym2X7e9koaa1RtY-nKkXQsDVU6Ph25_9GkvVuyhS72bwKhN1P",
|
|
),
|
|
),
|
|
)
|
|
: CircularProgressIndicator();
|
|
},
|
|
);
|
|
}
|
|
}
|
|
|