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

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

Closed
HiIamAlanOu opened this issue Oct 7, 2019 · 16 comments
Closed

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

HiIamAlanOu opened this issue Oct 7, 2019 · 16 comments
Labels
enhancement New feature or request fixed

Comments

@HiIamAlanOu
Copy link
Contributor

HiIamAlanOu commented Oct 7, 2019

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.(HiIamAlanOu@d7b4a1a)

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(flutter/flutter#25630) and create your own webview plugin.

@sarbagyastha
Copy link
Owner

@HiIamAlanOu Thank you for your suggestions. I'll definitely work on your suggestions once i get well. For inline playback, I had been previously maintaining a plugin ytview, which was a fork of official webview_flutter plugin which enabled autoplay and inline playback. But with later versions i decided to use the webview_flutter instead as it would be more optimized and frequently updated.

@Xoshbin
Copy link

Xoshbin commented Oct 10, 2019

@sarbagyastha Can you please go back to ytveiw because inline playback was the best feature of this plugin and the only reason I'm using it. thank you

@sarbagyastha
Copy link
Owner

Can you check with Version 5 ?

@py-zoid
Copy link

py-zoid commented Oct 13, 2019

Issue still persists with 5.0.0+1.

@sarbagyastha
Copy link
Owner

@py-zoid have you checked with real device instead of simulator ?

@Xoshbin
Copy link

Xoshbin commented Oct 15, 2019

On Android it gives this error: Failed assertion: boolean expression must not be null and in the thumbnails it says "No Connection Error Code: 400". didn't test it on iOS yet.

@sarbagyastha
Copy link
Owner

@Xoshbin can you please provide some logs ?

@Xoshbin
Copy link

Xoshbin commented Oct 15, 2019

I/flutter (26745): Flutter error caught by Crashlytics plugin:
E/CrashlyticsPlugin(26745): Unable to generate stack trace element from Dart side error.
I/chatty  (26745): uid=10343(tech.amro.amro) identical 7 lines
E/CrashlyticsPlugin(26745): Unable to generate stack trace element from Dart side error.
I/flutter (26745): News bloc linkposts/11
I/flutter (26745): News api linkposts/11
W/zze     (26745): Application name is not set. Call Builder#setApplicationName.
W/zze     (26745): Application name is not set. Call Builder#setApplicationName.
I/flutter (26745): Error reported to Crashlytics.
W/zze     (26745): Application name is not set. Call Builder#setApplicationName.
W/zze     (26745): Application name is not set. Call Builder#setApplicationName.
I/System.out(26745): (HTTPLog)-Static: isSBSettingEnabled false
I/System.out(26745): (HTTPLog)-Static: isSBSettingEnabled false
D/NetworkManagementSocketTagger(26745): tagSocket(68) with statsTag=0xffffffff, statsUid=-1
I/FirebaseRemoteConfig(26745): Fetch succeeded!
W/zze     (26745): Application name is not set. Call Builder#setApplicationName.
W/zze     (26745): Application name is not set. Call Builder#setApplicationName.
I/flutter (26745): page items14
D/ViewRootImpl@f397a2c[MainActivity](26745): ViewPostIme pointer 0
D/ViewRootImpl@f397a2c[MainActivity](26745): ViewPostIme pointer 1
D/ViewRootImpl@f397a2c[MainActivity](26745): ViewPostIme pointer 0
D/ViewRootImpl@f397a2c[MainActivity](26745): ViewPostIme pointer 1
I/flutter (26745): News bloc linkhotnews/11
I/flutter (26745): News api linkhotnews/11
W/zze     (26745): Application name is not set. Call Builder#setApplicationName.
W/zze     (26745): Application name is not set. Call Builder#setApplicationName.
I/flutter (26745): News bloc linkcatposts/7
I/flutter (26745): News api linkcatposts/7
I/System.out(26745): (HTTPLog)-Static: isSBSettingEnabled false
I/System.out(26745): (HTTPLog)-Static: isSBSettingEnabled false
W/zze     (26745): Application name is not set. Call Builder#setApplicationName.
W/zze     (26745): Application name is not set. Call Builder#setApplicationName.
I/System.out(26745): (HTTPLog)-Static: isSBSettingEnabled false
I/System.out(26745): (HTTPLog)-Static: isSBSettingEnabled false
I/flutter (26745): News bloc linkhotnews/11
I/flutter (26745): News api linkhotnews/11
W/zze     (26745): Application name is not set. Call Builder#setApplicationName.
W/zze     (26745): Application name is not set. Call Builder#setApplicationName.
I/System.out(26745): (HTTPLog)-Static: isSBSettingEnabled false
I/System.out(26745): (HTTPLog)-Static: isSBSettingEnabled false
D/NetworkManagementSocketTagger(26745): tagSocket(63) with statsTag=0xffffffff, statsUid=-1
D/NetworkManagementSocketTagger(26745): tagSocket(65) with statsTag=0xffffffff, statsUid=-1
I/FirebaseRemoteConfig(26745): Fetch succeeded!
W/zze     (26745): Application name is not set. Call Builder#setApplicationName.
W/zze     (26745): Application name is not set. Call Builder#setApplicationName.
I/FirebaseRemoteConfig(26745): Fetch succeeded!
W/zze     (26745): Application name is not set. Call Builder#setApplicationName.
W/zze     (26745): Application name is not set. Call Builder#setApplicationName.
I/flutter (26745): page items14

════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following assertion was thrown building _Player(dirty, state: __PlayerState#30a4e):
Failed assertion: boolean expression must not be null


Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=BUG.md

User-created ancestor of the error-causing widget was: 
  YoutubePlayer file:///Users/khoshbinali/StudioProjects/flutter/lib/src/tabs/videoTab.dart:469:36
When the exception was thrown, this was the stack: 
#0      __PlayerState.boolean (package:youtube_player_flutter/src/player/player.dart:334:33)
#1      __PlayerState.player (package:youtube_player_flutter/src/player/player.dart:239:39)
#2      __PlayerState.build (package:youtube_player_flutter/src/player/player.dart:52:21)
#3      StatefulElement.build (package:flutter/src/widgets/framework.dart:4047:27)
#4      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3941:15)
...
════════════════════════════════════════════════════════════════════════════════════════════════════

════════ (2) Exception caught by widgets library ═══════════════════════════════════════════════════
Failed assertion: boolean expression must not be null
User-created ancestor of the error-causing widget was: 
  YoutubePlayer file:///Users/khoshbinali/StudioProjects/flutter/lib/src/tabs/videoTab.dart:469:36
════════════════════════════════════════════════════════════════════════════════════════════════════
I/FirebaseRemoteConfig(26745): Fetch succeeded!

════════ (3) Exception caught by widgets library ═══════════════════════════════════════════════════
Failed assertion: boolean expression must not be null
User-created ancestor of the error-causing widget was: 
  YoutubePlayer file:///Users/khoshbinali/StudioProjects/flutter/lib/src/tabs/videoTab.dart:469:36
════════════════════════════════════════════════════════════════════════════════════════════════════
E/flutter (26745): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: MissingPluginException(No implementation found for method getDatabasesPath on channel com.tekartik.sqflite)
E/flutter (26745): #0      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:314:7)
E/flutter (26745): <asynchronous suspension>
E/flutter (26745): #1      invokeMethod (package:sqflite/src/sqflite_impl.dart:20:13)
E/flutter (26745): #2      SqfliteDatabaseFactoryImpl.invokeMethod (package:sqflite/src/factory_impl.dart:29:7)
E/flutter (26745): #3      SqfliteDatabaseFactoryMixin.safeInvokeMethod.<anonymous closure> (package:sqflite/src/factory_mixin.dart:24:35)
E/flutter (26745): #4      wrapDatabaseException (package:sqflite/src/exception_impl.dart:8:34)
E/flutter (26745): <asynchronous suspension>
E/flutter (26745): #5      SqfliteDatabaseFactoryImpl.wrapDatabaseException (package:sqflite/src/factory_impl.dart:25:7)
E/flutter (26745): #6      SqfliteDatabaseFactoryMixin.safeInvokeMethod (package:sqflite/src/factory_mixin.dart:24:7)
E/flutter (26745): #7      SqfliteDatabaseFactoryMixin.getDatabasesPath (package:sqflite/src/factory_mixin.dart:140:17)
E/flutter (26745): <asynchronous suspension>
E/flutter (26745): #8      getDatabasesPath (package:sqflite/sqflite.dart:169:54)
E/flutter (26745): #9      CacheStore._getObjectProvider (package:flutter_cache_manager/src/cache_store.dart:39:31)
E/flutter (26745): <asynchronous suspension>
E/flutter (26745): #10     new CacheStore (package:flutter_cache_manager/src/cache_store.dart:35:28)
E/flutter (26745): #11     new BaseCacheManager (package:flutter_cache_manager/src/cache_manager.dart:64:17)
E/flutter (26745): #12     new DefaultCacheManager._ (package:flutter_cache_manager/src/cache_manager.dart:34:29)
E/flutter (26745): #13     new DefaultCacheManager (package:flutter_cache_manager/src/cache_manager.dart:29:23)
E/flutter (26745): #14     CachedNetworkImageState._cacheManager (package:cached_network_image/src/cached_image_widget.dart:334:35)
E/flutter (26745): #15     CachedNetworkImageState._getFromMemory (package:cached_network_image/src/cached_image_widget.dart:260:12)
E/flutter (26745): #16     CachedNetworkImageState._animatedWidget (package:cached_network_image/src/cached_image_widget.dart:264:22)
E/flutter (26745): #17     CachedNetworkImageState.build (package:cached_network_image/src/cached_image_widget.dart:196:12)
E/flutter (26745): #18     StatefulElement.build (package:flutter/src/widgets/framework.dart:4047:27)
E/flutter (26745): #19     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3941:15)
E/flutter (26745): #20     Element.rebuild (package:flutter/src/widgets/framework.dart:3738:5)
E/flutter (26745): #21     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3924:5)
E/flutter (26745): #22     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4088:11)
E/flutter (26745): #23     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3919:5)
E/flutter (26745): #24     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
E/flutter (26745): #25     MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5233:32)
E/flutter (26745): #26     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
E/flutter (26745): #27     Element.updateChild (package:flutter/src/widgets/framework.dart:2904:12)
E/flutter (26745): #28     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5127:14)
E/flutter (26745): #29     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
E/flutter (26745): #30     Element.updateChild (package:flutter/src/widgets/framework.dart:2904:12)
E/flutter (26745): #31     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5127:14)
E/flutter (26745): #32     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
E/flutter (26745): #33     Element.updateChild (package:flutter/src/widgets/framework.dart:2904:12)
E/flutter (26745): #34     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3961:16)
E/flutter (26745): #35     Element.rebuild (package:flutter/src/widgets/framework.dart:3738:5)
E/flutter (26745): #36     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3924:5)
E/flutter (26745): #37     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3919:5)
E/flutter (26745): #38     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
E/flutter (26745): #39     Element.updateChild (package:flutter/src/widgets/framework.dart:2904:12)
E/flutter (26745): #40     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3961:16)
E/flutter (26745): #41     Element.rebuild (package:flutter/src/widgets/framework.dart:3738:5)
E/flutter (26745): #42  
I/chatty  (26745): uid=10343(tech.amro.amro) Thread-18 identical 1 line
E/flutter (26745): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: MissingPluginException(No implementation found for method getDatabasesPath on channel com.tekartik.sqflite)
E/flutter (26745): #0      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:314:7)
E/flutter (26745): <asynchronous suspension>
E/flutter (26745): #1      invokeMethod (package:sqflite/src/sqflite_impl.dart:20:13)
E/flutter (26745): #2      SqfliteDatabaseFactoryImpl.invokeMethod (package:sqflite/src/factory_impl.dart:29:7)
E/flutter (26745): #3      SqfliteDatabaseFactoryMixin.safeInvokeMethod.<anonymous closure> (package:sqflite/src/factory_mixin.dart:24:35)
E/flutter (26745): #4      wrapDatabaseException (package:sqflite/src/exception_impl.dart:8:34)
E/flutter (26745): <asynchronous suspension>
E/flutter (26745): #5      SqfliteDatabaseFactoryImpl.wrapDatabaseException (package:sqflite/src/factory_impl.dart:25:7)
E/flutter (26745): #6      SqfliteDatabaseFactoryMixin.safeInvokeMethod (package:sqflite/src/factory_mixin.dart:24:7)
E/flutter (26745): #7      SqfliteDatabaseFactoryMixin.getDatabasesPath (package:sqflite/src/factory_mixin.dart:140:17)
E/flutter (26745): <asynchronous suspension>
E/flutter (26745): #8      getDatabasesPath (package:sqflite/sqflite.dart:169:54)
E/flutter (26745): #9      CacheStore._getObjectProvider (package:flutter_cache_manager/src/cache_store.dart:39:31)
E/flutter (26745): <asynchronous suspension>
E/flutter (26745): #10     new CacheStore (package:flutter_cache_manager/src/cache_store.dart:35:28)
E/flutter (26745): #11     new BaseCacheManager (package:flutter_cache_manager/src/cache_manager.dart:64:17)
E/flutter (26745): #12     new DefaultCacheManager._ (package:flutter_cache_manager/src/cache_manager.dart:34:29)
E/flutter (26745): #13     new DefaultCacheManager (package:flutter_cache_manager/src/cache_manager.dart:29:23)
E/flutter (26745): #14     CachedNetworkImageState._cacheManager (package:cached_network_image/src/cached_image_widget.dart:334:35)
E/flutter (26745): #15     CachedNetworkImageState._getFromMemory (package:cached_network_image/src/cached_image_widget.dart:260:12)
E/flutter (26745): #16     CachedNetworkImageState._animatedWidget (package:cached_network_image/src/cached_image_widget.dart:264:22)
E/flutter (26745): #17     CachedNetworkImageState.build (package:cached_network_image/src/cached_image_widget.dart:196:12)
E/flutter (26745): #18     StatefulElement.build (package:flutter/src/widgets/framework.dart:4047:27)
E/flutter (26745): #19     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3941:15)
E/flutter (26745): #20     Element.rebuild (package:flutter/src/widgets/framework.dart:3738:5)
E/flutter (26745): #21     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3924:5)
E/flutter (26745): #22     StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4088:11)
E/flutter (26745): #23     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3919:5)
E/flutter (26745): #24     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
E/flutter (26745): #25     MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5233:32)
E/flutter (26745): #26     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
E/flutter (26745): #27     Element.updateChild (package:flutter/src/widgets/framework.dart:2904:12)
E/flutter (26745): #28     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5127:14)
E/flutter (26745): #29     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
E/flutter (26745): #30     Element.updateChild (package:flutter/src/widgets/framework.dart:2904:12)
E/flutter (26745): #31     SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5127:14)
E/flutter (26745): #32     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
E/flutter (26745): #33     Element.updateChild (package:flutter/src/widgets/framework.dart:2904:12)
E/flutter (26745): #34     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3961:16)
E/flutter (26745): #35     Element.rebuild (package:flutter/src/widgets/framework.dart:3738:5)
E/flutter (26745): #36     ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3924:5)
E/flutter (26745): #37     ComponentElement.mount (package:flutter/src/widgets/framework.dart:3919:5)
E/flutter (26745): #38     Element.inflateWidget (package:flutter/src/widgets/framework.dart:3101:14)
E/flutter (26745): #39     Element.updateChild (package:flutter/src/widgets/framework.dart:2904:12)
E/flutter (26745): #40     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3961:16)
E/flutter (26745): #41     Element.rebuild (package:flutter/src/widgets/framework.dart:3738:5)
E/flutter (26745): #42  
W/zze     (26745): Application name is not set. Call Builder#setApplicationName.

════════ (4) Exception caught by widgets library ═══════════════════════════════════════════════════
Failed assertion: boolean expression must not be null
User-created ancestor of the error-causing widget was: 
  YoutubePlayer file:///Users/khoshbinali/StudioProjects/flutter/lib/src/tabs/videoTab.dart:469:36
════════════════════════════════════════════════════════════════════════════════════════════════════

════════ (5) Exception caught by widgets library ═══════════════════════════════════════════════════
Failed assertion: boolean expression must not be null
User-created ancestor of the error-causing widget was: 
  YoutubePlayer file:///Users/khoshbinali/StudioProjects/flutter/lib/src/tabs/videoTab.dart:469:36
════════════════════════════════════════════════════════════════════════════════════════════════════

════════ (6) Exception caught by widgets library ═══════════════════════════════════════════════════
Failed assertion: boolean expression must not be null
User-created ancestor of the error-causing widget was: 
  YoutubePlayer file:///Users/khoshbinali/StudioProjects/flutter/lib/src/tabs/videoTab.dart:469:36

@sarbagyastha
Copy link
Owner

@Xoshbin Couldn't recreate the problem. Can you please add some code snippet so that i can recreate the issue?

@Xoshbin
Copy link

Xoshbin commented Oct 15, 2019

String videoId;
              videoId =
                  YoutubePlayer.convertUrlToId(snapshot.data.data[index].slug);
new Container(
                            child: YoutubePlayer(
                              context: context,
                              videoId: videoId,
                              flags: YoutubePlayerFlags(
                                autoPlay: videoAutoPlay,
                                showVideoProgressIndicator: true,
                                enableCaption: false,
                                loop: false,
                              ),
                              progressIndicatorColor: Colors.red,
                              progressColors: ProgressBarColors(
                                playedColor: Colors.red,
                                handleColor: Colors.redAccent,
                              ),
                              bottomActions: [
                                CurrentPosition(),
                                ProgressBar(isExpanded: true,),
                                TotalDuration(),
                              ],
                              liveUIColor: Colors.redAccent,
                            ),
                          )

@Xoshbin
Copy link

Xoshbin commented Oct 15, 2019

The first issue was because of the variable "videoAutoPlay" in my code, after changing it to "false" it's fixed. but now the "Error Code: 400" issue is still exist from the first to third videos. because in my app the list is all videos. and after going down from the list and going up again they are working. So basically it looks like when the list is loaded first it gives this error to those that are on the screen and when you go down the videos are working without issue because they were not on the screen when the list is loaded. and after going up again those videos that they were not working at the beginning they are going to work because they have been out of the screen and back again.

@sarbagyastha
Copy link
Owner

@Xoshbin will test in the scenario you mentioned.

@Xoshbin
Copy link

Xoshbin commented Oct 22, 2019

@sarbagyastha Thanks mate 👍

@Xoshbin
Copy link

Xoshbin commented Oct 23, 2019

@sarbagyastha is V5.1.0 support inline playback, I mean multiple videos in a list? because I see you swiped back to webview_fluuter instead of ytview library. thanks.

@sarbagyastha
Copy link
Owner

It should play at least on Android. Will publish beta version of the player within next two days with forked webview_flutter too and web support.

@sarbagyastha sarbagyastha added the enhancement New feature or request label Oct 23, 2019
@sarbagyastha
Copy link
Owner

Fixed with version 5 and up.

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