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

outdated

A Webview Flutter plugin of Tencent X5 Kernel,Improving WebView browsing experience,Support Android Platform Only.

example/lib/main.dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:x5_webview/x5_sdk.dart';

import 'demo.dart';

void main() async {
  var isOK=await X5Sdk.init();
  print(isOK?"X5内核成功加载":"X5内核加载失败");
  runApp(MyApp());
}

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(home: HomePage());
  }
}

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Plugin example app'),
      ),
      body: Center(
        child: ListView(
          children: <Widget>[
            RaisedButton(
                onPressed: () async {
                  var canUseTbsPlayer = await X5Sdk.canUseTbsPlayer();
                  if (canUseTbsPlayer) {
                    await X5Sdk.openVideo(
                        "https://ifeng.com-l-ifeng.com/20180528/7391_46b6cf3b/index.m3u8");
                  } else {
                    print("x5Video不可用");
                  }
                },
                child: Text("x5video直接播放视频")),
            RaisedButton(
                onPressed: () async {
                  Navigator.of(context)
                      .push(CupertinoPageRoute(builder: (BuildContext context) {
                    return DemoWebViewPage();
                  }));
                },
                child: Text("flutter内嵌x5webview")),
            RaisedButton(
                onPressed: () async {
                  X5Sdk.openWebActivity(
                      "https://www.baidu.com",
                      title: "web页面");
                },
                child: Text("x5webviewActivity")),
          ],
        ),
      ),
    );
  }
}
17
likes
0
pub points
61%
popularity

Publisher

unverified uploader

A Webview Flutter plugin of Tencent X5 Kernel,Improving WebView browsing experience,Support Android Platform Only.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on x5_webview