sarbagyastha / youtube_player_flutter

A Flutter plugin for inline playback or streaming of YouTube videos using the official iFrame Player API.
https://youtube.sarbagyastha.com.np
BSD 3-Clause "New" or "Revised" License
716 stars 832 forks source link

[BUG] Youtube Icon in Youtube Player IFrame push to Web page not available #866

Open PUAJINGYI opened 1 year ago

PUAJINGYI commented 1 year ago

Describe the bug When I click the youtube icon provided by the player, it redirects to webpage with below error: Web page not available The web page at intent://m.youtube.com/watch?time_continue=145&v=tcodrIK2P_I&embeds_referring_euri=https%3A%2F%2Fwww.youtube.com%2F&embeds_referring_origin=https%3A%2F%2Fwww.youtube.com&source_ve_path=Mjg2NjY&feature=emb_logo&feature=mweb_302redirect_to_app_11264154#Intent;package=com.google.android.youtube;scheme=vnd.youtube;launchFlags=268435456;end; could not be loaded because:

net::ERR_UNKNOWN_URL_SCHEME this error found in flutter app when click the youtube iframe player's youtube icon

To Reproduce Steps to reproduce the behavior: 1) run the screen 2) click the youtube icon in the player

Expected behavior It should be redirects to Youtube App for displaying the video instead.

Screenshots The screen before clicking the youtube icon in the player: WhatsApp Image 2023-08-31 at 2 25 15 AM

After clicking youtube ico: WhatsApp Image 2023-08-31 at 2 25 16 AM

Technical Details:

Code `import 'dart:developer';

import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:youtube_player_iframe/youtube_player_iframe.dart';

class YoutubeAppDemo extends StatefulWidget { @override _YoutubeAppDemoState createState() => _YoutubeAppDemoState(); }

class _YoutubeAppDemoState extends State { late YoutubePlayerController _controller;

@override void initState() { super.initState(); _controller = YoutubePlayerController.fromVideoId( videoId: 'H5v3kku4y6Q', autoPlay: false, params: const YoutubePlayerParams( showControls: true, mute: false, showFullscreenButton: true, loop: false, ), );

_controller.setFullScreenListener(
  (isFullScreen) {
    log('${isFullScreen ? 'Entered' : 'Exited'} Fullscreen.');
  },
);

}

@override Widget build(BuildContext context) { return YoutubePlayerScaffold( controller: _controller, builder: (context, player) { return Scaffold( body: Stack( children: [ LayoutBuilder( builder: (context, constraints) { if (kIsWeb && constraints.maxWidth > 750) { return Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox(height: 100.0), Expanded( flex: 20, child: Column( children: [ player, ], ), ), ], ); }

              return ListView(
                children: [
                   SizedBox(height: 100.0),
                  player,
                ],
              );
            },
          ),
          Positioned(
            top: 25,
            left: 0,
            right: 0,
            child: Container(
              height: kToolbarHeight,
              alignment: Alignment.center,
              child: Text(
                'PT Activity Library',
                style: TextStyle(
                  fontSize: 20.0,
                  fontWeight: FontWeight.bold,
                  color: Colors.black,
                ),
              ),
            ),
          ),
        ],
      ),
    );
  },
);

}

@override void dispose() { _controller.close(); super.dispose(); } } `

quadriq commented 4 months ago

any news on this? I get same thing