0
votes

I used flutter_webview_plugin 0.3.8, I embedd vimeo player and played it on ios the fullscreen button shows up but not in android.

The website has iframe on it,

"<--iframe src="https://player.vimeo.com/video/{video id here..}?title=0&byline=0&portrait=0" width="100vh" height="100%" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen>"

return WebviewScaffold(

url: widget.data.link,
withJavascript: true, 
withZoom: false,  
appBar: AppBar(
   title: Text(""),
   elevation: 1
),
initialChild: Container(
  color: Colors.white,
  child: const Center(
  child: SpinKitRing(
      color: Colors.black,
      size: 30.0,
      lineWidth: 2.0,
  ),
),)  );

enter image description here enter image description here

1
unfortunately still little information on implementation of vimeo for flutter, I have already searched for something related is not successful. - Andre Azevedo
In the case of Android, why not show a custom button below the WebView and open a new screen where you show the video in landscape mode in fullscreen? - Shajeel Afzal
Also, share your full code. - Shajeel Afzal
Hey..Did you get the answer for this? - MohdNaseem
Hi, if you are interested, I have made a plugin wrapping the vimeo player. github.com/ThuAbLKA/flutter-vimeo-player check it out! - thusith.92

1 Answers

0
votes

I've tried locally and it seems that this is actually a bug.

Here is a sample running in the latest version webview_flutter: ^2.0.12 plugin.

Android:

enter image description here

iOS:

enter image description here

Sample code:

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

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Sample',
      theme: ThemeData(
        primarySwatch: Colors.teal,
      ),
      home: MyHomePage(title: 'Sample'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: WebView(
          initialUrl: 'https://vimeo.com/521802279',
          javascriptMode: JavascriptMode.unrestricted),
    );
  }
}