Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove default youtube video #93

Closed
up2code opened this issue Oct 20, 2019 · 17 comments
Closed

Remove default youtube video #93

up2code opened this issue Oct 20, 2019 · 17 comments
Labels
enhancement New feature or request fixed

Comments

@up2code
Copy link

up2code commented Oct 20, 2019

When I run video id that error (In my case is error code 150). Sometime it fallback to video https://www.youtube.com/watch?v=50kklGefAcs and I found that this video id had defined in lib/src/player.dart

Should it be removed?

Example video error

Test base on

  • youtube_player_flutter : 5.0.0+1
  • Flutter : 1.9.1+hotfix.2
  • Physical android device (Android 9)
@sarbagyastha
Copy link
Owner

@up2code I forgot to remove it. Thank you! Will remove it.

@SayaGames
Copy link

SayaGames commented Oct 21, 2019

Yes, I'm going to report default movie issue.

VideoData {"duration":608.401,"videoUrl":"https://www.youtube.com/watch?v=yhrLHNFF8Ig","availableQualityLevels":["hd1080","hd720","large","medium","small","tiny","auto"],"videoEmbedCode":"<iframe width="100" height="100" src="https://www.youtube.com/embed/50kklGefAcs\" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>"}

New Nepali Movie - 2017/2074 | Bhanchhu Aaja || Ma Yesto Geet Gaauchu || Ft Pooja Sharma, Paul Shah

### Also I get "Error code 400 No connection" when the player starts play and 1-2 seconds later. (on the black video player screen)

By the way, thanks for your efforts about updating the player

@sarbagyastha
Copy link
Owner

@SayaGames are you sure internet was working correctly? Can you provide with code snippet to recreate the issue ?

@SayaGames
Copy link

SayaGames commented Oct 22, 2019

I tried at home wifi, at work wifi and mobile network. (real device and android emulator)

  • First: Player is shown correctly, (when page is loaded)
    image

  • but 2-3 seconds later, player status is changing to error display
    image

  • It's weird that, if I back to previous page and re-enter the player page again, everything is normal.

  • Normal is: Error display is gone. And I also mentioned in the issue Adapts to quality as per the bandwidth #94, intermittent playback is (sometimes) gone. Playing correctly.

  • My Player code is below:
    Stack(
    children: [
    Center(
    child: YoutubePlayer(
    context: context,
    videoId: url1,
    inFullScreen: false,
    flags: YoutubePlayerFlags(
    mute: false,
    autoPlay: false,
    loop: false,
    forceHideAnnotation: true,
    showVideoProgressIndicator: true,
    disableDragSeek: false,
    hideThumbnail: false,
    isLive: false,
    ),
    progressIndicatorColor: Color(0xFFFF0000),
    topActions: [
    Text(globals.title,
    style: TextStyle(
    color: Colors.white,
    fontSize: 13,
    fontWeight: FontWeight.normal
    ),
    ),
    ],
    bottomActions: [
    CurrentPosition(),
    ProgressBar(isExpanded: true),
    TotalDuration(),
    ],
    onPlayerInitialized: (controller) {
    _controller1 = controller;
    },
    ),
    ),

                 ],
               ),
    
  • This is the trace when the Error 400 is shown:
    E/BufferQueueProducer( 9444): [SurfaceTexture-0-9444-0] setAsyncMode: BufferQueue has been abandoned
    E/BufferQueueProducer( 9444): [SurfaceTexture-0-9444-0] queueBuffer: BufferQueue has been abandoned
    E/BufferQueueProducer( 9444): [SurfaceTexture-0-9444-0] dequeueBuffer: BufferQueue has been abandoned
    E/BufferQueueProducer( 9444): [SurfaceTexture-0-9444-0] setAsyncMode: BufferQueue has been abandoned
    E/eglCodecCommon( 9444): glUtilsParamSize: unknow param 0x000085b5
    I/chatty ( 9444): uid=10085(com.bilgisel.makamat) RenderThread identical 2 lines
    E/eglCodecCommon( 9444): glUtilsParamSize: unknow param 0x000085b5
    D/EGL_emulation( 9444): eglMakeCurrent: 0xe1f07760: ver 2 0 (tinfo 0xc9cb1310)
    E/BufferQueueProducer( 9444): [SurfaceTexture-0-9444-1] cancelBuffer: BufferQueue has been abandoned
    E/eglCodecCommon( 9444): glUtilsParamSize: unknow param 0x000085b5
    I/chatty ( 9444): uid=10085(com.bilgisel.makamat) RenderThread identical 2 lines
    E/eglCodecCommon( 9444): glUtilsParamSize: unknow param 0x000085b5
    D/EGL_emulation( 9444): eglMakeCurrent: 0xbf1fd980: ver 2 0 (tinfo 0xbaad8d50)
    D/EGL_emulation( 9444): eglMakeCurrent: 0xbf1fd980: ver 2 0 (tinfo 0xbaad8d50)
    W/cr_ChildProcessConn( 9444): onServiceDisconnected (crash or killed by oom): pid=9509

@Xoshbin
Copy link

Xoshbin commented Oct 22, 2019

It looks like it's same behavior as mine #79 (comment)

@SayaGames
Copy link

Hi,
Newly encountered for me: I also saw the video instead of black error display now:
New Nepali Movie - 2017/2074 | Bhanchhu Aaja || Ma Yesto Geet Gaauchu || Ft Pooja Sharma, Paul Shah

@sarbagyastha
Copy link
Owner

Does the issue persist on Version 5.1.0 ?

@up2code
Copy link
Author

up2code commented Oct 24, 2019

@sarbagyastha On version 5.1.0 fallback video not show anymore. Thank you very much! but now for video error sometime it display only play button or circle progress indicator instead of error message.

I had tested by create playlist screen with two ListTile (2 youtube url with error) and tap to change videoId value. But that minor issue for me. So maybe we can close this?

@sarbagyastha
Copy link
Owner

@up2code With version 5.2.0, there's slight change in API. And it should fix your problem.

@up2code
Copy link
Author

up2code commented Oct 24, 2019

@sarbagyastha Thank you so much for your hard work! It show error now when tap on video with error. But when I tap back to load playable url (I had changed to using YoutubePlayerController.load(videoId) ), player not update and still display previous error message and below is exception log that throw in console.

E/flutter ( 3207): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: MissingPluginException(No implementation found for method evaluateJavascript on channel plugins.flutter.io/webview_0)
E/flutter ( 3207): #0      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:314:7)
E/flutter ( 3207): <asynchronous suspension>
E/flutter ( 3207): #1      MethodChannelWebViewPlatform.evaluateJavascript (package:webview_flutter/src/webview_method_channel.dart:90:21)
E/flutter ( 3207): #2      WebViewController.evaluateJavascript (package:webview_flutter/webview_flutter.dart:626:39)
E/flutter ( 3207): #3      YoutubePlayerController._evaluateJS (package:youtube_player_flutter/src/utils/youtube_player_controller.dart:155:30)
E/flutter ( 3207): #4      YoutubePlayerController.load (package:youtube_player_flutter/src/utils/youtube_player_controller.dart:170:5)
E/flutter ( 3207): #5      _YoutubePlaylistPageState.buildPlayer.<anonymous closure> (package:vocadb/pages/youtube_playlist/youtube_playlist_page.dart:130:29)

Test on android 9 physical device with version 5.2.0

@sarbagyastha
Copy link
Owner

Could you please attach code snippet, how you're loading videos?

@up2code
Copy link
Author

up2code commented Oct 25, 2019

@sarbagyastha Sure, below I test with simple stateful widget with 2 valid and 1 error video. No problem when try tap ListTile to load valid videoId. But if I tap on error one error message will display on player (But no exception yet) and when I try to tap on valid one, Exception message will show in console. Did I used api correctly?

class _TestWebViewState extends State<TestWebView> {
  YoutubePlayerController _controller;

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Test playlist'),
      ),
      body: Column(
        children: <Widget>[
          YoutubePlayer(
            context: context,
            initialVideoId: 'AufydOsiD6M',
            flags: YoutubePlayerFlags(
              autoPlay: false,
              showVideoProgressIndicator: true,
            ),
            onPlayerInitialized: (controller) {
              _controller = controller;
            },
          ),
          Expanded(
            child: ListView(
              children: <Widget>[
                ListTile(
                  title: Text('Valid 1'),
                  onTap: () {
                    _controller.load('AufydOsiD6M');
                  },
                ),
                ListTile(
                  title: Text('Valid 2'),
                  onTap: () {
                    _controller.load('V-189K9CcQw');
                  },
                ),
                ListTile(
                  title: Text('Error video'),
                  onTap: () {
                    _controller.load('j9YNUsBgDE');
                  },
                ),
              ],
            ),
          )
        ],
      ),
    );
  }
}

@sarbagyastha
Copy link
Owner

I guess it should be fixed with 5.2.0+1, have you tried with that ?

@up2code
Copy link
Author

up2code commented Oct 25, 2019

@sarbagyastha I just tried with 5.2.0+1. Now valid video can play after previous error video, but error message won't show up if next one I tap on error video. I had tested and found it will display error message when I play error video first. If I tap valid one and tap to error video, It show only play button.

You can try on my code snippet on above one.

@sarbagyastha
Copy link
Owner

Oh! I think a reload action should be added for such scenario, will look at it once i get free.

@sarbagyastha sarbagyastha added enhancement New feature or request WIP Work In Progress fixed and removed fixed WIP Work In Progress labels Nov 1, 2019
@sarbagyastha
Copy link
Owner

Should fix with Version 6.0.0.

@up2code
Copy link
Author

up2code commented Nov 5, 2019

Seem like it fixed now. Thank you so much!

@up2code up2code closed this as completed Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed
Projects
None yet
Development

No branches or pull requests

4 participants