hls_player 0.0.1 copy "hls_player: ^0.0.1" to clipboard
hls_player: ^0.0.1 copied to clipboard

outdated

A new flutter plugin project.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:hls_player/hls_player.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  static Future<void> initPlatformState() async {
    String url =
        "http://200.23.206.107:18080/canales/nacionales/tvnHD2/playlist.m3u8";
    // Platform messages may fail, so we use a try/catch PlatformException.
    try {
      await HlsPlayer.initialize(url: url);
    } on PlatformException {}
  }

  Widget testWidget = new MediaQuery(
    data: new MediaQueryData(),
    child: new MaterialApp(
      home: Scaffold(
          body: RaisedButton(
        child: Text(
          'Search',
          style: TextStyle(fontSize: 18.0),
        ),
        onPressed: () {
          initPlatformState();
        },
      )),
    ),
  );

  @override
  Widget build(BuildContext context) {
    return testWidget;
  }
}
8
likes
0
pub points
64%
popularity

Publisher

unverified uploader

A new flutter plugin project.

Homepage

License

unknown (LICENSE)

Dependencies

flutter, meta

More

Packages that depend on hls_player