Flutter plugin for playing or streaming YouTube videos inline using the official iFrame Player API.

Overview

Youtube Player IFrame

YOUTUBE PLAYER IFRAME

pub package licence Download Stars Top Language effective dart Web DEMO

Flutter plugin for playing or streaming YouTube videos inline using the official iFrame Player API. The package exposes almost all the API provided by iFrame Player API. So, it's 100% customizable.

Note: This package only provides default youtube web player's skin. If you need Youtube Android player like player with gesture support, use youtube_player_flutter instead. youtube_player_flutter also uses this package as dependency. (Migration Pending)

Supported Platforms:

  • Android
  • iOS
  • Web

YOUTUBE PLAYER IFRAME

Click here for WEB DEMO

Salient Features

  • Inline Playback
  • Supports captions
  • No need for API Key
  • Supports custom controls
  • Retrieves video meta data
  • Supports Live Stream videos
  • Supports changing playback rate
  • Support for both Android and iOS
  • Adapts to quality as per the bandwidth
  • Exposes builders for building custom controls
  • Playlist Support (Both custom and Youtube's playlist)

For Web, Flutter's HtmlElementView. For Android & iOS, the package uses flutter_inappwebview under-the-hood.

If your app uses services workers, you may need add additional configuration on the app startup code, in order to ensure that the web view behaviour don't get unstable. To do so, please refer to the flutter_inappwebview documentation.

Since flutter_inappwebview relies on Flutter's mechanism for embedding Android and iOS views, this plugin might share some known issues tagged with the platform-views label.

Requirements

  • Android: minSdkVersion 17 and add support for androidx (see AndroidX Migration)
  • iOS: --ios-language swift, Xcode version >= 11
  • Web: None

Setup

Web

No Configuration Required.

iOS

No Configuration Required.

Follow the guide here for complete iOS setup

Android

Set minSdkVersion of your android/app/build.gradle file to at least 17.

Follow the guide here for complete Android setup

Note: Although the minimum to be set is 17, the player won't play on device with API < 20 (19 if Hybrid Composition is enabled). For API < 20 devices, you might want to forward the video to be played using YouTube app instead, using packages like url_launcher or android_intent.

Using the player

YoutubePlayerController _controller = YoutubePlayerController(
    initialVideoId: 'K18cpp_-gP8',
    params: YoutubePlayerParams(
        playlist: ['nPt8bK2gbaU', 'gQDByCdjUXw'], // Defining custom playlist
        startAt: Duration(seconds: 30),
        showControls: true,
        showFullscreenButton: true,
    ),
);

YoutubePlayerIFrame(
    controller: _controller,
    aspectRatio: 16 / 9,
),

-------------- OR --------------

YoutubePlayerControllerProvider( // Provides controller to all the widget below it.
  controller: _controller,
  child: YoutubePlayerIFrame(
    aspectRatio: 16 / 9,
  ),
);

// Access the controller as: `YoutubePlayerControllerProvider.of(context)` or `controller.ytController`.

Want to customize the player?

The package provides YoutubeValueBuilder, which can be used to create any custom controls.

For example, let's create a custom play pause button.

YoutubeValueBuilder(
   controller: _controller, // This can be omitted, if using `YoutubePlayerControllerProvider`
   builder: (context, value) {
      return IconButton(
         icon: Icon( 
                  value.playerState == PlayerState.playing
                    ? Icons.pause
                    : Icons.play_arrow,
         ),
         onPressed: value.isReady
            ? () {
                  value.playerState == PlayerState.playing
                    ? context.ytController.pause()
                    : context.ytController.play();
                 }
            : null,
      );
   },
);

Available Methods

Methods available for YoutubePlayerController.

Method Description
play() Plays the currently cued/loaded video.
pause() Pauses the currently playing video.
stop() Stops and cancels loading of the current video.
nextVideo() Loads and plays the next video in the playlist.
previousVideo() Loads and plays the previous video in the playlist.
playVideoAt(index) Loads and plays the specified video in the playlist.
load(videoId, {startAt, endAt}) Loads and plays the specified video.
cue(videoId, {startAt, endAt}) Loads the specified video's thumbnail and prepares the player to play the video.
loadPlaylist(list, {listType, startAt, index}) Loads the specified list and plays it.
cuePlaylist(list, {listType, startAt, index}) Queues the specified list of videos.
mute() Mutes the player.
unMute() Unmutes the player.
setVolume(volume) Sets the volume of player.
seekTo(position, {allowSeekAhead}) Seeks to a specified time in the video.
setSize(size) Sets the size in pixels of the player.
setPlaybackRate(rate) Sets the playback speed for the video.
setLoop(loop) Enables or disables looping.
setShuffle(shuffle) Enables or disables shuffling playlist.
reset() Resets the controller.
convertUrlToId(url, {trimWhiteSpaces}) Converts fully qualified YouTube Url to video id.
getThumbnail(videoId, {quality, webp}) Grabs YouTube video's thumbnail for provided video id.
onEnterFullScreen() Called when player enters fullscreen.
onExitFullScreen() Called when player exits fullscreen.
invokeJavascript(function) Invoke custom javascript function.
hideTopMenu() Hides the title and share icons at the top of player (May violate YouTube's TOS. Use at your own risk.)
hidePauseOverlay() Hides the related videos overlay while player is paused (May violate YouTube's TOS. Use at your own risk.)

Youtube Player Parameters

All the available parameters.

Parameter Description
autoPlay Specifies whether the initial video will automatically start to play when the player loads. Default = true
mute Mutes the player. Default = false
captionLanguage Caption language. Default = 'en'
enableCaption Enables caption by default. Default = true
color Specifies the color that will be used in the player's video progress bar to highlight the amount of the video that the viewer has already seen. Default = red
showControls Indicates whether the video player controls are displayed. Default = true
enableKeyboard Enables or disables the player to respond to keyboard controls. Default = false
enableJavaScript Enables or disables the player to be controlled via IFrame or JavaScript Player API calls. Default = true
endAt Ends the playback in specified time.
showFullscreenButton Shows or hides the fullscreen button from displaying in the player. Default = false
interfaceLanguage Sets the player's interface language.
showVideoAnnotations Enables or disables video annotations to be shown by default. Default = true
loop Enables or disables the player to play the initial video again and again. Default = true
playlist Specifies a list of video IDs to be played after initialVideoId.
playsInline Controls whether videos play inline or fullscreen in an HTML5 player on iOS. Default = true
strictRelatedVideos Enabling ensure that related videos will come from the same channel as the video that was just played. Default = false
startAt Starts the video at specified time.
desktopMode The controls will be alike Youtube Desktop's controls.
useHybridComposition Enable Hybrid Composition

Limitation

For Android: Since the plugin is based on platform views. This plugin requires Android API level 19 or greater.

License

Copyright 2021 Sarbagya Dhaubanjar. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above
      copyright notice, this list of conditions and the following
      disclaimer in the documentation and/or other materials provided
      with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Comments
  • Unhandled Exception: PlatformException(evaluateJavaScript_failed, Failed evaluating JavaScript ... )

    Unhandled Exception: PlatformException(evaluateJavaScript_failed, Failed evaluating JavaScript ... )

    Hey there!

    This package seemed to look pretty cool so I gave it a shot. Unfortunately I get this error under iOS (haven't tested Android yet) when I hit the play button.

    19:22:03.079 282 info flutter.tools [VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: PlatformException(evaluateJavaScript_failed, Failed evaluating JavaScript, JavaScript string was: 'player.cueVideoById("secret-but-correct-video-id", 0)'

    19:22:03.079 283 info flutter.tools Error Domain=WKErrorDomain Code=5 "JavaScript execution returned a result of an unsupported type" UserInfo={NSLocalizedDescription=JavaScript execution returned a result of an unsupported type})

    I did run pod install and also flutter clean. The video thumbnail is showing up in my view so I guess thats at least a partial success.

    fixed 
    opened by robin7331 29
  • [NEW] youtube_player_iframe package

    [NEW] youtube_player_iframe package

    Published a new package youtube_player_iframe. This package will be migrated to use it as dependency.

    The new package is one-to-one mapping of Youtube Iframe Player API.

    Why new package?

    The current package have some issues like:

    • has only one player skin
    • switching to fullscreen has bugs (due to limitation of platform views)
    • ads not showing up
    • code was a bit messy (as i started it when i was not so experienced πŸ˜‰)
    • only worked on Android & iOS.

    How the new package try to solve this?

    • The new package exposes all the APIs, so that one can easily build custom player as per their needs.
    • Relies on fullscreen view of platform itself, instead of trying to solve it though platform views, so is quite stable.
    • As per Requirements for ads for embedded videos
      1. The playback shouldn't be scripted, and it was always scripted on the current package. While, in the new one, the playback can be click-to-play as no custom skin is rendered over the default player.
      2. The playback should be under trusted sites.
    • Cleaner code.
    • Works on Web too.
    • Supports playlists.

    What about the current package?

    The current package will be refactored to use the new package as dependency. It will provide the same custom skin as it is providing today and I'll try not to add any large breaking changes. But the package will only be optimsed to use single player per page. It won't support list of player as it's very complex to handle fullscreen switch, with multiple players that too with existing limitations of platform views. The new package should be used for the purpose.

    After the current package is refactored. It will be almost similar in terms of features with the new one, with all the added refactors and optimizations, with a custom skin on top of it.

    enhancement 
    opened by sarbagyastha 23
  • [BUG] Error 150 on some videos

    [BUG] Error 150 on some videos

    This is the video: https://www.youtube.com/watch?v=GUqcY8WNTZs

    Error: The owner of the requested video may not allow it to be played.

    Video embedding is turned on for the video and other videos.

    bug fixed 
    opened by edeuss 23
  • Does not play the video on iOS

    Does not play the video on iOS

    Sadly, i cannot get it to work on iOS. In Android it works fine. In iOS it just does not play the video and sometimes I experienced freezes.

    I tested it with two iOS devices (iPad 2017 with iOS 12 and iPad Air with iOS 10). There is no error message in the Debug Console, it just loads forever.

    I used your example project with the most up to date plugin version (but also tried 1.0.0 with the same result). And also tried it with my real world project.

    I added this to Info.plist: <key>io.flutter.embedded_views_preview</key> <true/>

    Have you tried the plugin on iOS devices? Any suggestions?

    fixed 
    opened by besserwisser 23
  • conflict with webview_flutter

    conflict with webview_flutter

    when I include both webview_flutter and youtube_player_flutter, application would crash upon starts with the following warning and error

    objc[44664]: Class FLTCookieManager is implemented in both /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/ytview.framework/ytview (0x10c3d8400) and /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/webview_flutter.framework/webview_flutter (0x10c3bb250). One of the two will be used. Which one is undefined.
    objc[44664]: Class FLTWKNavigationDelegate is implemented in both /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/ytview.framework/ytview (0x10c3d8450) and /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/webview_flutter.framework/webview_flutter (0x10c3bb2a0). One of the two will be used. Which one is undefined.
    objc[44664]: Class FLTWebViewFactory is implemented in both /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/ytview.framework/ytview (0x10c3d84a0) and /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/webview_flutter.framework/webview_flutter (0x10c3bb2f0). One of the two will be used. Which one is undefined.
    objc[44664]: Class FLTWebViewController is implemented in both /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/ytview.framework/ytview (0x10c3d84c8) and /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/webview_flutter.framework/webview_flutter (0x10c3bb318). One of the two will be used. Which one is undefined.
    objc[44664]: Class FLTJavaScriptChannel is implemented in both /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/ytview.framework/ytview (0x10c3d8540) and /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/webview_flutter.framework/webview_flutter (0x10c3bb390). One of the two will be used. Which one is undefined.
    objc[44664]: Class FLTWebViewFlutterPlugin is implemented in both /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/ytview.framework/ytview (0x10c3d85b8) and /Users/ace/Library/Developer/CoreSimulator/Devices/B18AEF78-2279-4A87-AF9C-EC10E395036D/data/Containers/Bundle/Application/7210DA0C-0DBD-40B3-82E4-83D52BA8ADF7/Runner.app/Frameworks/webview_flutter.framework/webview_flutter (0x10c3bb458). One of the two will be used. Which one is undefined.
    2019-05-04 09:20:00.568482+0700 Runner[44664:362412] libMobileGestalt MobileGestalt.c:890: MGIsDeviceOneOfType is not supported on this platform.
    2019-05-04 09:20:00.844000+0700 Runner[44664:362412] You've implemented -[<UIApplicationDelegate> application:performFetchWithCompletionHandler:], but you still need to add "fetch" to the list of your supported UIBackgroundModes in your Info.plist.
    2019-05-04 09:20:00.844196+0700 Runner[44664:362412] You've implemented -[<UIApplicationDelegate> application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.
    2019-05-04 09:20:00.845692+0700 Runner[44664:362412] *** Assertion failure in -[FlutterEngine registrarForPlugin:], ../../flutter/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm:560
    2019-05-04 09:20:00.917563+0700 Runner[44664:362412] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Duplicate plugin key: FLTWebViewFlutterPlugin'
    *** First throw call stack:
    (
    	0   CoreFoundation                      0x000000010d4296fb __exceptionPreprocess + 331
    	1   libobjc.A.dylib                     0x000000010c9cdac5 objc_exception_throw + 48
    	2   CoreFoundation                      0x000000010d429482 +[NSException raise:format:arguments:] + 98
    	3   Foundation                          0x000000010c41b927 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 194
    	4   Flutter                             0x000000010a5a3d6b -[FlutterEngine registrarForPlugin:] + 269
    	5   Runner                              0x000000010a29be1e +[GeneratedPluginRegistrant registerWithRegistry:] + 174
    	6   Runner                              0x000000010a29bf18 $s6Runner11AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtF + 168
    	7   Runner                              0x000000010a29c254 $s6Runner11AppDelegateC11application_29didFinishLaunchingWithOptionsSbSo13UIApplicationC_SDySo0j6LaunchI3KeyaypGSgtFTo + 196
    	8   UIKitCore                           0x0000000116d3b311 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 280
    	9   UIKitCore                           0x0000000116d3ccad -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3932
    	10  UIKitCore                           0x0000000116d420c6 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1617
    	11  UIKitCore                           0x00000001165876d6 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 904
    	12  UIKitCore                           0x000000011658ffce +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
    	13  UIKitCore                           0x00000001165872ec -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236
    	14  UIKitCore                           0x0000000116587c48 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1091
    	15  UIKitCore                           0x0000000116585fba __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 782
    	16  UIKitCore                           0x0000000116585c71 -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 433
    	17  UIKitCore                           0x000000011658a9b6 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 576
    	18  UIKitCore                           0x000000011658b610 _performActionsWithDelayForTransitionContext + 100
    	19  UIKitCore                           0x000000011658a71d -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 223
    	20  UIKitCore                           0x000000011658f6d0 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
    	21  UIKitCore                           0x0000000116d409a8 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 514
    	22  UIKitCore                           0x00000001168f7dfa -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
    	23  FrontBoardServices                  0x0000000118d71125 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 448
    	24  FrontBoardServices                  0x0000000118d7aed6 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 283
    	25  FrontBoardServices                  0x0000000118d7a700 __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 53
    	26  libdispatch.dylib                   0x0000000110db5db5 _dispatch_client_callout + 8
    	27  libdispatch.dylib                   0x0000000110db92ba _dispatch_block_invoke_direct + 300
    	28  FrontBoardServices                  0x0000000118dac146 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
    	29  FrontBoardServices                  0x0000000118dabdfe -[FBSSerialQueue _performNext] + 451
    	30  FrontBoardServices                  0x0000000118dac393 -[FBSSerialQueue _performNextFromRunLoopSource] + 42
    	31  CoreFoundation                      0x000000010d390be1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    	32  CoreFoundation                      0x000000010d390463 __CFRunLoopDoSources0 + 243
    	33  CoreFoundation                      0x000000010d38ab1f __CFRunLoopRun + 1231
    	34  CoreFoundation                      0x000000010d38a302 CFRunLoopRunSpecific + 626
    	35  GraphicsServices                    0x0000000111ba92fe GSEventRunModal + 65
    	36  UIKitCore                           0x0000000116d43ba2 UIApplicationMain + 140
    	37  Runner                              0x000000010a29c3f8 main + 72
    	38  libdyld.dylib                       0x0000000110e2a541 start + 1
    	39  ???                                 0x0000000000000001 0x0 + 1
    )
    libc++abi.dylib: terminating with uncaught exception of type NSException
    

    I had to remove webview_flutter to be able to run the application.

    I only tested this problem on iOS using simulator.

    fixed 
    opened by 3ace 23
  • [FEATURE REQUEST] Playing video without fullscreen on iOS

    [FEATURE REQUEST] Playing video without fullscreen on iOS

    When I play the video, the player automatically goes into fullscreen.

    Is there a way of playing the video without fullscreen being forced?

    If not, it would be a nice to have a flag to control this.

    enhancement 
    opened by louisdeb 17
  • Remove default youtube video

    Remove default youtube video

    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

    • https://www.youtube.com/watch?v=yilfICzwrSM
    • https://www.youtube.com/watch?v=-j9YNUsBgDE

    Test base on

    • youtube_player_flutter : 5.0.0+1
    • Flutter : 1.9.1+hotfix.2
    • Physical android device (Android 9)
    enhancement fixed 
    opened by up2code 17
  • [BUG] Player crashes suddently (worked until some days ago). Maybe related to Chrome 81?

    [BUG] Player crashes suddently (worked until some days ago). Maybe related to Chrome 81?

    Describe the bug Player crashes on Android (I'm using Mi 9T with Android 10). It worked like a charm until few days ago. I don't know if it is related to the version of Chrome. Tried with emulator with Chrome 80 and it works.

    Edit: Confirm it is caused by Chrome 81 and "forceHideAnnotations: true" as discovered by this comment. Partial fix is do not use forceHideAnnotations.

    To Reproduce Play the video with any ID (I tried with id: U_XsRZXL2Ic )

    Expected behavior Player should play the video

    Technical Details:

    • Device: Android Mi 9T
    • OS: Android 10 Q
    • Version 29

    Additional context App crashes and this is the log:

    I/WebViewFactory( 6349): Loading com.google.android.webview version 81.0.4044.111 (code 404411133) I/cr_LibraryLoader( 6349): Loaded native library version number "81.0.4044.111" W/Gralloc3( 6349): allocator 3.x is not supported D/EgretLoader( 6349): EgretLoader(Context context) D/EgretLoader( 6349): The context is not activity W/erocks.eventda( 6349): Accessing hidden method Landroid/media/AudioManager;->getOutputLatency(I)I (greylist, reflection, allowed) W/cr_media( 6349): Requires BLUETOOTH permission W/VideoCapabilities( 6349): Unsupported mime image/vnd.android.heic W/VideoCapabilities( 6349): Unsupported mime video/divx W/VideoCapabilities( 6349): Unsupported mime video/divx4 W/VideoCapabilities( 6349): Unrecognized profile/level 0/3 for video/mpeg2 W/VideoCapabilities( 6349): Unrecognized profile/level 0/3 for video/mpeg2 W/VideoCapabilities( 6349): Unsupported mime video/x-ms-wmv W/ContentCatcher( 6349): Failed to notify a WebView W/chromium( 6349): [WARNING:minidump_to_upload_parameters.cc(67)] duplicate annotation name ptype, discarding value browser D/NetworkSecurityConfig( 6349): No Network Security Config specified, using platform default I/chromium( 6349): [INFO:CONSOLE(384)] "Unrecognized feature: 'picture-in-picture'.", source: https://s.ytimg.com/yts/jsbin/www-widgetapi-vflLsCj8Z/www-widgetapi.js (384) E/chromium( 6349): [ERROR:validation_errors.cc(76)] Invalid message: VALIDATION_ERROR_DESERIALIZATION_FAILED (content.mojom.SynchronousCompositorControlHost.0 ) E/chromium( 6349): [ERROR:render_process_host_impl.cc(4867)] Terminating render process for bad Mojo message: Received bad user message: Validation failed for content.mojom.SynchronousCompositorControlHost.0 [VALIDATION_ERROR_DESERIALIZATION_FAILED (content.mojom.SynchronousCompositorControlHost.0 ) E/chromium( 6349): [ERROR:bad_message.cc(27)] Terminating renderer for bad IPC message, reason 123 W/Looper ( 6349): Slow Looper main: doFrame is 331ms late E/InputMethodManager( 6349): b/117267690: Failed to get fallback IMM with expected displayId=10 actual IMM#displayId=0 view=io.flutter.plugins.webviewflutter.InputAwareWebView{3118869 VFEDHVC.. ........ 0,0-987,555} E/chromium( 6349): [ERROR:aw_browser_terminator.cc(125)] Renderer process (6465) crash detected (code -1). E/chromium( 6349): [ERROR:aw_browser_terminator.cc(90)] Render process (6465) kill (OOM or update) wasn't handed by all associated webviews, killing application.

    bug question 
    opened by pdivita 16
  • I find the problem that playing videos on ios is not working.

    I find the problem that playing videos on ios is not working.

    According to this css file(https://sarbagyadhaubanjar.github.io/youtube_player/ios/player.css), this css attribute (transform-origin: left top;) doesnt apply in safari.

    @sarbagyastha use a css trick that zoom in and out the web page to remove(become almost invisible) the title and related videos on the youtube embed player.

    I make a version that be able to playing the videos on ios, but I have no idea to remove the title and related videos.

    You can check out the latest commit in my github.(https://github.com/HiIamAlanOu/youtube_player_flutter/commit/d7b4a1aa2d698b2cfc274e04999739d352b70652)

    Video doesn't play inline on some iPhone in this version.

    If you want to play inline on iPhone, maybe you can check out this issue(https://github.com/flutter/flutter/issues/25630) and create your own webview plugin.

    enhancement fixed 
    opened by HiIamAlanOu 16
  • [BUG] Video Unavailable

    [BUG] Video Unavailable

    Describe the bug Some videos can not be loaded. The iframe just shows "Video Unavailable" for the video. The same video did work in an older version of the package (v2.3.0).

    To Reproduce Open the demo https://sarbagyastha.com.np/youtube_player_flutter/#/ Load the video with Id: H5v3kku4y6Q

    Expected behavior The video is playable. The video (H5v3kku4y6Q) can be embedded in an iframe: https://jsfiddle.net/c9wg4tx8/

    bug 
    opened by rckrd-proguitar 15
  • Next Video Playing, State change

    Next Video Playing, State change

    Hi, I need to play random video from a playlist. In the listener method, I can catch endstate and generate random video from a playlist. But PlayerState doesn't pass to playing state.

    MY CODE SNIPPET: void listener() { if (_controller.value.playerState == PlayerState.ended ) { ....

        _controller.load( YoutubePlayer.convertUrlToId(<MY VIDEO URL),startAt:0);
        _controller.play();
      setState(() {});
    

    (After trying dozens of times, automatically, gives this error:) ERROR: ════════ Exception caught by foundation library ════════════════════════════════════════════════════ The following StackOverflowError was thrown while dispatching notifications for YoutubePlayerController: Stack Overflow

    enhancement fixed 
    opened by SayaGames 15
  • [BUG] showModalBottomSheet renders incorrectly with YoutubePlayerScaffold

    [BUG] showModalBottomSheet renders incorrectly with YoutubePlayerScaffold

    Describe the bug A clear and concise description of what the bug is.

    To Reproduce Steps to reproduce the behavior:

    Expected behavior A clear and concise description of what you expected to happen.

    Screenshots If applicable, add screenshots to help explain your problem.

    Technical Details:

    • Device: [e.g. iPhone6]
    • OS: [e.g. iOS8.1]
    • Version [e.g. 22]

    Additional context Add any other context about the problem here.

    bug 
    opened by sayol 0
  • Feature : Total Video Duration

    Feature : Total Video Duration

    Feature : Total Video Duration

    ISSUE : Total Video Duration [FEATURE REQUEST] https://github.com/sarbagyastha/youtube_player_flutter/issues/642

    Added TotalDuration Feature. Updated Readme for the TotalDuration Feature.

    opened by Abhishek-165 0
  • [BUG]The program crashed.

    [BUG]The program crashed.

    youtube_player_flutter: 8.1.2

    Describe the bug I tested for about 4 hours, and the program crashed twice.

    LOG: F/libc ( 5107): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x763c6d7228 in tid 5107 (icalcloud.debug), pid 5107 (icalcloud.debug)


    Build fingerprint: 'HUAWEI/WLZ-AL10/HWWLZ:10/HUAWEIWLZ-AL10/102.0.0.230C00:user/release-keys' Revision: '0' ABI: 'arm64' SYSVMTYPE: Maple APPVMTYPE: Art Timestamp: 2022-12-27 10:33:10+0800 pid: 5107, tid: 5107, name: package >>> package <<< uid: 10630 signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x763c6d7228 x0 000000763c7f7000 x1 0000000000001000 x2 0000000000000003 x3 0000000000000001 x4 0000000000000136 x5 0000000000000000 x6 00000000ffffffff x7 0000000000000000 x8 000000763c6d7000 x9 0000000000000001 x10 0000000000000001 x11 0000000000000000 x12 00000000ffffffd8 x13 0000007fcc67e350 x14 fffffffffffffff8 x15 0000000000000068 x16 000000759d572b50 x17 000000763c94fa80 x18 0000000000000029 x19 00000073d78cef00 x20 00000400760bb000 x21 000000754b6ba3c0 x22 00000073ea28df10 x23 000000738912d010 x24 000000754bd483b0 x25 0000000000000000 x26 0000000000003084 x27 00000073dd4b8c48 x28 00000075aa10fdf8 x29 0000000000000000 sp 0000007fcc67e330 lr 000000759cee2aa0 pc 000000759cee2ac4 backtrace: #00 pc 0000000002199ac4 /vendor/lib64/egl/libGLES_mali.so (BuildId: ce4c191ff7791465c85a32d410859ed1) #01 pc 000000000219b418 /vendor/lib64/egl/libGLES_mali.so (BuildId: ce4c191ff7791465c85a32d410859ed1) #02 pc 00000000021b1ef4 /vendor/lib64/egl/libGLES_mali.so (BuildId: ce4c191ff7791465c85a32d410859ed1) #03 pc 00000000021b0c88 /vendor/lib64/egl/libGLES_mali.so (BuildId: ce4c191ff7791465c85a32d410859ed1) #04 pc 0000000000022828 /system/lib64/libEGL.so (android::eglSwapBuffersWithDamageKHRImpl(void*, void*, int*, int)+620) (BuildId: 9f54126ca3c5e205a088560d488b3844) #05 pc 000000000001ef58 /system/lib64/libEGL.so (eglSwapBuffersWithDamageKHR+104) (BuildId: 9f54126ca3c5e205a088560d488b3844) #06 pc 00000000015be9c4 /data/app/package-UY6FRo9g2igSGzIIn9HbNg==/lib/arm64/libflutter.so (BuildId: 28af3c003dc3df47d321bb57bca9a9abd73a75f4) #07 pc 4485e99644828000 Lost connection to device.

    To Reproduce No rule of program crash was found. The process of my test is to enter the page of multiple players, play the video, and exit the page while the video is playing. In addition, when the video is playing, switch the program to the background and back to the foreground.

    Technical Details:

    • Device: HUAWEI nova6
    • OS: android 10
    
    [√] Flutter (Channel stable, 3.3.9, on Microsoft Windows [η‰ˆζœ¬ 10.0.19042.630], locale zh-CN)
        β€’ Flutter version 3.3.9 on channel stable at D:\flutter\flutter
        β€’ Upstream repository https://github.com/flutter/flutter/
        β€’ FLUTTER_GIT_URL = https://github.com/flutter/flutter/
        β€’ Framework revision b8f7f1f986 (5 weeks ago), 2022-11-23 06:43:51 +0900
        β€’ Engine revision 8f2221fbef
        β€’ Dart version 2.18.5
        β€’ DevTools version 2.15.0
        β€’ Pub download mirror https://pub.flutter-io.cn
        β€’ Flutter download mirror https://storage.flutter-io.cn
    
    
    [√] Connected device (5 available)
        β€’ WLZ AL10 (mobile) β€’ FMLDU19C13016286 β€’ android-arm64  β€’ Android 10 (API 29)
                  
    
    bug youtube_player_flutter 
    opened by lan2000 0
  • Manually Setting Up Video Upload Handle

    Manually Setting Up Video Upload Handle

    I have been using the plugin for a long time. However, there is a situation that I cannot solve. I want the user to switch the video to manual upload state. How can I do that?

    opened by Chemeindefer 1
  • Conflict with flutter_facebook_auth package

    Conflict with flutter_facebook_auth package

    There is a problem and a conflict when using youtube_player_flutter with flutter_facebook_auth , as shown in the attached video If the player works in the fullscreen mode, the video control features in terms of play and pause are disabled It only works again when the operator's position is changed to normal mode Also, in the fullscreen mode, any elements that are placed above the player using the stack widget disappeared , and this is I put them as a custom controler for player

    https://user-images.githubusercontent.com/25283526/205732469-c1d3836c-0f51-4e3f-8870-a76af6849b51.mp4

    nshots to help explain your problem.

    Technical Details:

    • Device:Readme 7 pro
    • OS: android 10
    • Version last version
    bug youtube_player_flutter 
    opened by hudaMohammed22 0
Releases(youtube_player_iframe-v3.0.3)
Owner
Sarbagya Dhaubanjar
Senior Software Engineer at @khalti
Sarbagya Dhaubanjar
A Flutter audio-plugin to playing and recording sounds

medcorder_audio Flutter record/play audio plugin. Developed for Evrone.com Funded by Medcorder Medcorder.com Getting Started For help getting started

Evrone 106 Oct 29, 2022
Flutter Music Player - A complete and open source music player designed in flutter.

Flutter Music Player A complete and open source music player designed in flutter. It is first complete music player designed in flutter. This app expl

Nabraj Khadka 3 Aug 20, 2022
YoYo Video Player is a HLS(.m3u8) video player for flutter.

YoYo Video Player YoYo Video Player is a HLS(.m3u8) video player for flutter. The video_player is a video player that allows you to select HLS video s

Ko Htut 89 Dec 23, 2022
Flutter-Music-Player - A simple music player app that let you play mp3 songs with some customization feature with a rich user interface

Flutter-Music-Player - A simple music player app that let you play mp3 songs with some customization feature with a rich user interface

Ashirbad Swain 6 Jan 4, 2023
A fully-functional video streaming app made in Flutter using Custom Nodejs backend.

LAVENDER ?? A fully-functional video streaming app like netflix made in Flutter using Custom Nodejs backend. How To Run This Project ??‍♂️ Clone the r

null 71 Jan 10, 2023
Apps For streaming audio via url (Android, iOS & Web ). Developed with Dart & Flutter ❀

Flutter Sleep App (Dicoding Submission : Learn to Make Flutter Apps for Beginners) Stream Great collection of high-definition sounds that can be mixed

Utrodus Said Al Baqi 13 Nov 29, 2022
A simple video streaming application made with Dart, JavaScript, HTML, CSS

streamZ A simple video streaming application made with Dart, JS, HTML, CSS & ❀️ Show some ❀️ by putting ⭐ Recently I wrote an article, explaining how

Anjan Roy 28 Nov 23, 2021
WaVe - an audio streaming platform which gives the best user experience without any compromise in the audio quality

WaVe is an audio streaming platform which gives the best user experience without any compromise in the audio quality, and there is even space for the users to explore their creativity. And makes it more efficient with the AI features.

OmarFayadhd 1 May 31, 2022
Use your Flutter knowledge to generate videos, animations and slideshows

Use your Flutter knowledge to generate videos, animations and slideshows! Automate your video production with server-side rendering. Footage is still

AloΓ―s Deniel 131 Dec 7, 2022
A simple YouTube Music Client written in Dart using Flutter Framework with @microsoft Fluent design guidlines

A simple YouTube Music Client written in Dart using Flutter Framework with @microsoft Fluent design guidlines

Suraj Pratap Singh 123 Jan 7, 2023
Flutter plugin for sound. Audio recorder and player.

Flutter Sound user: your documentation is there The CHANGELOG file is here Overview Flutter Sound is a Flutter package allowing you to play and record

null 764 Jan 2, 2023
Flutter plugin for sound. Audio recorder and player.

Sounds Sounds is a Flutter package allowing you to play and record audio for both the android and ios platforms. Sounds provides both a high level API

Brett Sutton 75 Dec 8, 2022
A Flutter media player plugin for iOS and android based on ijkplayer

Flutter media player plugin for android/iOS based on ijkplayer.

δΊŽι£žη™½ε‘€ 1.4k Jan 4, 2023
Official Flutter SDK for LiveKit. Easily add real-time video and audio to your Flutter apps.

LiveKit Flutter SDK Official Flutter SDK for LiveKit. Easily add real-time video and audio to your Flutter apps. This package is published to pub.dev

LiveKit 116 Dec 14, 2022
A simple music player made using Flutter.

Music Player App This is a beautiful music player, developed using Flutter. Features Play any song included in Flutter Assets Background Play Beautifu

Hash Studios 15 May 21, 2022
A Music Player App made using Flutter.

A local music player app made using flutter. Getting Started This project is a starting point for a Flutter application. A few resources to get you st

Jobin Biju 13 Dec 22, 2022
Audio player app in Flutter. Created as a tutorial for learning Flutter.

Music Player: create a simple Flutter music player app This is a Flutter project used during a series of articles on I should go to sleep. License Cop

Michele Volpato 11 May 5, 2022
Flutter radio player mod flutter 2.5

A Flutter plugin to play streaming audio content with background support and lock screen controls.

Ayotunde abdulsalam 1 Mar 14, 2022
The video player for Flutter with a heart of gold

chewie The video player for Flutter with a heart of gold. The video_player plugin provides low-level access to video playback. Chewie uses the video_p

Brian Egan 1.6k Jan 7, 2023