youtube_player_flutter
youtube_player_flutter copied to clipboard
Tapping Information opens a webview within the app instead of opening video on Youtube App.
Describe the bug Hello,
When I tap on the Avatar, title, or watch later the apps open youtube in a webview. I would like the app to launch youtube instead. Is there a method available that would allow me to do this? Ideally, I would've like to hide the avatar and information from the player, but it looks like it's require by the YoutubeIFrameApi.
To Reproduce When the player it's paused or started:
- Tap Avatar or Title,
- User Profile or video will open in a webview within the app in Desktop size.
Expected behavior Open Youtube App
Screenshots If applicable, add screenshots to help explain your problem.
-
Video Info Displaying
-
Webview
Technical Details:
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Version [e.g. 22]
Code import 'package:flutter/material.dart'; import 'package:youtube_player_iframe/youtube_player_iframe.dart';
void main() { runApp(MyApp()); }
class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, ), home: MyHomePage(title: 'Flutter Demo Home Page'), ); } }
class MyHomePage extends StatefulWidget { MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override _MyHomePageState createState() => _MyHomePageState(); }
class _MyHomePageState extends State<MyHomePage> { @override Widget build(BuildContext context) { YoutubePlayerController _controller = YoutubePlayerController( initialVideoId: 'j4_Pj1rYpr8', params: YoutubePlayerParams( startAt: Duration(seconds: 0), showControls: true, showFullscreenButton: true, autoPlay: true, forceHD: true, ), );
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Column(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
height: MediaQuery.of(context).orientation == Orientation.portrait
? MediaQuery.of(context).size.height * .25
: MediaQuery.of(context).size.height * .81,
width: double.infinity,
child: YoutubePlayerIFrame(
controller: _controller,
aspectRatio: 16 / 9,
),
),
],
),
);
} }
I am having the same issue is there any workaround or settings we can change to fix this behaviour ?
@horeyes @arodriguezgb With v1.0.1, I have disabled navigation inside webview. So the issue of launching youtube inside webview shouldn't exist anymore.
Also, added a method hideTopMenu()
to hide those titles & share icons. But using it may violate YouTube's TOS.
Fantastic, thank you @sarbagyastha that was fast.
I'm glad to hear that you have disabled navigation inside webview but please have a look at this, I think this considered as a bug, on hold of video player reveal the list of options (equivalent to right-click on youtube player), do you think that behavior should be disabled as well?
P.S. after upgrading to v1.0.1, the autoPlay
param doesn't seem to work, can you please confirm? Thanks :D
_controller.hideTopMenu() & _controller.hidePauseOverlay() not working from me . Even after using above -- share, watch later, info etc are visible even for pause overlay.
Please check
@HenglyEver
Have you got any solutions
I'm glad to hear that you have disabled navigation inside webview but please have a look at this, I think this considered as a bug, on hold of video player reveal the list of options (equivalent to right-click on youtube player), do you think that behavior should be disabled as well?
P.S. after upgrading to v1.0.1, the
autoPlay
param doesn't seem to work, can you please confirm? Thanks :D
I'm glad to hear that you have disabled navigation inside webview but please have a look at this, I think this considered as a bug, on hold of video player reveal the list of options (equivalent to right-click on youtube player), do you think that behavior should be disabled as well?
P.S. after upgrading to v1.0.1, the
autoPlay
param doesn't seem to work, can you please confirm? Thanks :D
The same happened to me on iOS, package version 6.1.1
yeah same thing happend to m3 @Uvelir , did you found a solution?
Regarding this feature, app redirection seems to be working fine in v2.1.0 but clicking the title or YouTube logo doesn't seem to work anymore.
Can this feature be restored please.
Edit: nvm. Saw that you'd added this a feature. However, I do feel that this should be changed as YouTube ToS mandates behavior of player shouldn't change and we are essentially changing the behavior.