flutter_tencentplayer 0.1.0 copy "flutter_tencentplayer: ^0.1.0" to clipboard
flutter_tencentplayer: ^0.1.0 copied to clipboard

outdated

Is a native plugin for playing Tencent Cloud on-demand videos, live streaming, offline downloads, etc.

example/lib/main.dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_tencentplayer_example/download_page.dart';
import 'package:flutter_tencentplayer_example/full_video_page.dart';

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

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

class _MyAppState extends State<MyApp> {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        theme: ThemeData(primaryColor: Colors.pink),
        debugShowCheckedModeBanner: false,
        routes: {
          '/': (_) => ListPage(),
          'full': (_) => FullVideoPage(),
          'download': (_) => DownloadPage(),
        }
    );
  }
}

enum PlayType {
  network,
  asset,
  file,
  fileId,
}

String networkMp4 = 'http://1252463788.vod2.myqcloud.com/95576ef5vodtransgzp1252463788/e1ab85305285890781763144364/v.f10.mp4';
String liveUrl = 'http://5815.liveplay.myqcloud.com/live/5815_89aad37e06ff11e892905cb9018cf0d4.flv';
String assetPath = 'static/tencent1.mp4';

class ListPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text('腾讯播放器Demo'),),
      body: ListView(
        children: <Widget>[
          ListTile(
            title: Text('网络视频'),
            onTap: () {
              Navigator.of(context).push(CupertinoPageRoute(builder: (_) => FullVideoPage(playType: PlayType.network, dataSource: networkMp4,)));
            },
          ),
          ListTile(
            title: Text('直播'),
            onTap: () {
              Navigator.of(context).push(CupertinoPageRoute(builder: (_) => FullVideoPage(playType: PlayType.network, dataSource: liveUrl, showBottomWidget: false, showClearBtn: false,)));
            },
          ),
          ListTile(
            title: Text('asset视频'),
            onTap: () {
              Navigator.of(context).push(CupertinoPageRoute(builder: (_) => FullVideoPage(playType: PlayType.asset, dataSource: assetPath,)));
            },
          ),
          ListTile(
            title: Text('下载播放视频'),
            onTap: () {
              Navigator.of(context).push(CupertinoPageRoute(builder: (_) => DownloadPage()));
            },
          ),
        ],
      ),
    );
  }
}
24
likes
0
pub points
66%
popularity

Publisher

unverified uploader

Is a native plugin for playing Tencent Cloud on-demand videos, live streaming, offline downloads, etc.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_tencentplayer