Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[video_player] Set audio mix options #2922

Merged
merged 1 commit into from
Aug 17, 2020

Conversation

wwwdata
Copy link
Contributor

@wwwdata wwwdata commented Aug 11, 2020

This is a replacement PR for #1174 because I lost access to the original repository I created the PR from.

How do I make the tests work? Unfortunately, I also had to modify the interface package.

@cyanglaz Pinging you like promised and maybe you can also help me out making the tests green and stuff :) But I have to say this new pigeon method of communicating with the native side is pretty awesome 👍
The only "dirty" thing was that when I created the new dart files, I lost some API test files that apparently were committed to the auto-generated file. I guess that is something that should be moved into a file that is not generated 😄

edited by cyanglaz: fixes flutter/flutter#30438

Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % nits
Thank you so much for being patient and going the extra mile to complete this PR!

@wwwdata wwwdata force-pushed the audio-player-mix-option branch from 74a37b4 to b074e04 Compare August 12, 2020 09:07
@wwwdata
Copy link
Contributor Author

wwwdata commented Aug 12, 2020

pushed with requested changes.

Copy link
Contributor

@cyanglaz cyanglaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. CI seems failing.

@wwwdata
Copy link
Contributor Author

wwwdata commented Aug 12, 2020

Yes the CI is failing because it cannot find the new class I added that is in the Interface package. Because it installs the latest released interface package. How to deal with such a situation?

@cyanglaz
Copy link
Contributor

I see! You might want to create a separate PR for the interface change. And we land the interface PR, then we can land the plugin PR.

@wwwdata
Copy link
Contributor Author

wwwdata commented Aug 12, 2020

I opened a PR with only changes for the interface package here: #2927
When that is merged I can edit my commit here and remove the interface changes.

@wwwdata wwwdata force-pushed the audio-player-mix-option branch from b074e04 to d4cb25f Compare August 12, 2020 22:13
@cyanglaz
Copy link
Contributor

@wwwdata The interface change has been published

@wwwdata wwwdata force-pushed the audio-player-mix-option branch from d4cb25f to 491c61e Compare August 13, 2020 06:39
@wwwdata
Copy link
Contributor Author

wwwdata commented Aug 13, 2020

hm, iOS podspec linting seems to be broken. What is causing it? I cannot really make sense of the error messages, can you help?

@cyanglaz
Copy link
Contributor

- ERROR | [iOS] build_pod: Static Analysis failed. You can use `--verbose` for more information. You can use `--no-clean` to save a reproducible buid environment.
Maybe try:
cd ios & pod lib lint --verbose

@wwwdata
Copy link
Contributor Author

wwwdata commented Aug 13, 2020

hm, I did that in the packages/video_player/video_player/ios subfolder and for me, it showed that it succeeded

    ** BUILD SUCCEEDED **

   Testing with `xcodebuild`.
 -> video_player (0.0.1)
    - NOTE  | xcodebuild:  note: Using new build system
    - NOTE  | xcodebuild:  note: Building targets in parallel
    - NOTE  | [iOS] xcodebuild:  note: Planning build
    - NOTE  | [iOS] xcodebuild:  note: Constructing build description
    - NOTE  | [iOS] xcodebuild:  warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')
    - NOTE  | [iOS] xcodebuild:  note: Execution policy exception registration failed and was skipped: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" (in target 'video_player' from project 'Pods')
    - NOTE  | [iOS] xcodebuild:  note: Execution policy exception registration failed and was skipped: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" (in target 'Pods-App' from project 'Pods')
    - NOTE  | [iOS] xcodebuild:  ld: warning: ignoring file /Users/benbieker/Library/Developer/Xcode/DerivedData/App-hdhkmassaptsdagmgypnbhjsradv/Build/Products/Release-iphonesimulator/video_player/video_player.framework/video_player, building for iOS Simulator-i386 but attempting to link with file built for iOS Simulator-x86_64
    - NOTE  | [iOS] xcodebuild:  ld: warning: ignoring file Flutter/Flutter.framework/Flutter, missing required architecture i386 in file Flutter/Flutter.framework/Flutter (3 slices)
    - NOTE  | [iOS] xcodebuild:  note: Execution policy exception registration failed and was skipped: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" (in target 'App' from project 'App')

video_player passed validation.

@cyanglaz
Copy link
Contributor

@wwwdata That's weird. I'm kicking off a re-run.

@wwwdata
Copy link
Contributor Author

wwwdata commented Aug 14, 2020

hmm, seems to be the same issue. Is there anybody else that can help? I don't really see the concrete error message in the build log output as well. So I don't know how to fix it right now, unfortunately.

@@ -4,7 +4,7 @@ description: Flutter plugin for displaying inline video with other Flutter
# 0.10.y+z is compatible with 1.0.0, if you land a breaking change bump
# the version to 2.0.0.
# See more details: https://github.com/flutter/flutter/wiki/Package-migration-to-1.0.0
version: 0.10.11+2
version: 0.10.12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to depend on the newly published platform interface plugin here?

@cyanglaz cyanglaz self-requested a review August 15, 2020 17:02
@cyanglaz
Copy link
Contributor

@jmagman Could you help us take a look :)
The ci says pod lib lint throws some error but both @wwwdata and I have tried locally with the same code and pod lib lint passed validation. Maybe we are missing something?

@jmagman
Copy link
Member

jmagman commented Aug 15, 2020

It's a bunch of null check static analyzer warnings, the line numbers are pointing to the right spot. Instead of (self.textureId ? self.textureId : [NSNull null]) you need to say (self.textureId != nil ? self.textureId : [NSNull null]) etc

    - WARN  | [iOS] xcodebuild:  /private/var/folders/3y/l0z1x3693dl_8n0qybp4dqwh0000gn/T/cirrus-ci-build/packages/video_player/video_player/ios/Classes/messages.m:59:51: warning: Converting a pointer value of type 'NSNumber * _Nullable' to a primitive boolean value; instead, either compare the pointer to nil or call -boolValue
    - WARN  | [iOS] xcodebuild:  /private/var/folders/3y/l0z1x3693dl_8n0qybp4dqwh0000gn/T/cirrus-ci-build/packages/video_player/video_player/ios/Classes/messages.m:111:37: warning: Converting a pointer value of type 'NSNumber * _Nullable' to a primitive boolean value; instead, either compare the pointer to nil or call -boolValue
    - WARN  | [iOS] xcodebuild:  /private/var/folders/3y/l0z1x3693dl_8n0qybp4dqwh0000gn/T/cirrus-ci-build/packages/video_player/video_player/ios/Classes/messages.m:112:37: warning: Converting a pointer value of type 'NSNumber * _Nullable' to a primitive boolean value; instead, either compare the pointer to nil or call -boolValue
    - WARN  | [iOS] xcodebuild:  /private/var/folders/3y/l0z1x3693dl_8n0qybp4dqwh0000gn/T/cirrus-ci-build/packages/video_player/video_player/ios/Classes/messages.m:132:37: warning: Converting a pointer value of type 'NSNumber * _Nullable' to a primitive boolean value; instead, either compare the pointer to nil or call -boolValue
    - WARN  | [iOS] xcodebuild:  /private/var/folders/3y/l0z1x3693dl_8n0qybp4dqwh0000gn/T/cirrus-ci-build/packages/video_player/video_player/ios/Classes/messages.m:133:37: warning: Converting a pointer value of type 'NSNumber * _Nullable' to a primitive boolean value; instead, either compare the pointer to nil or call -boolValue
    - WARN  | [iOS] xcodebuild:  /private/var/folders/3y/l0z1x3693dl_8n0qybp4dqwh0000gn/T/cirrus-ci-build/packages/video_player/video_player/ios/Classes/messages.m:152:37: warning: Converting a pointer value of type 'NSNumber * _Nullable' to a primitive boolean value; instead, either compare the pointer to nil or call -boolValue
    - WARN  | [iOS] xcodebuild:  /private/var/folders/3y/l0z1x3693dl_8n0qybp4dqwh0000gn/T/cirrus-ci-build/packages/video_player/video_player/ios/Classes/messages.m:153:37: warning: Converting a pointer value of type 'NSNumber * _Nullable' to a primitive boolean value; instead, either compare the pointer to nil or call -boolValue
    - WARN  | [iOS] xcodebuild:  /private/var/folders/3y/l0z1x3693dl_8n0qybp4dqwh0000gn/T/cirrus-ci-build/packages/video_player/video_player/ios/Classes/messages.m:169:37: warning: Converting a pointer value of type 'NSNumber * _Nullable' to a primitive boolean value; instead, either compare the pointer to nil or call -boolValue
    - WARN  | [iOS] xcodebuild:  /private/var/folders/3y/l0z1x3693dl_8n0qybp4dqwh0000gn/T/cirrus-ci-build/packages/video_player/video_player/ios/Classes/FLTVideoPlayerPlugin.m:505:5: warning: nil returned from a method that is expected to return a non-null value

@jmagman
Copy link
Member

jmagman commented Aug 15, 2020

@jmagman Could you help us take a look :)
The ci says pod lib lint throws some error but both @wwwdata and I have tried locally with the same code and pod lib lint passed validation. Maybe we are missing something?

Run with --analyze and you'll see it.

@wwwdata
Copy link
Contributor Author

wwwdata commented Aug 15, 2020

@jmagman interesting. Fixing all the lint "warnings" actually made the check green. What is confusing me about this is that the code was generated from code generation inside the messages.m file and the other part that complains about the nil return value in the create method was also code I did not touch :P So how was this working and got merged before?

Do those linting errors now pop up because of some linter rule changes maybe? It will be an issue the next time somebody runs the code auto-generation again. So I guess manually fixing it should not be the solution.

@wwwdata wwwdata force-pushed the audio-player-mix-option branch 4 times, most recently from f7db541 to ec9e8bc Compare August 15, 2020 20:04
@wwwdata
Copy link
Contributor Author

wwwdata commented Aug 15, 2020

Ok, I think I got it now and the tests should become green. So It seems that the auto-generated code must have been manually edited. So I went over the diff and undid everything the code generator incorrectly generated.

@LockedThread
Copy link

I just want to say thank you so much for working on this because I've been waiting on this to be pushed publicly for about a year now. Once this is published, I won't have to keep my fork of this going on.

@cyanglaz
Copy link
Contributor

@jmagman interesting. Fixing all the lint "warnings" actually made the check green. What is confusing me about this is that the code was generated from code generation inside the messages.m file and the other part that complains about the nil return value in the create method was also code I did not touch :P So how was this working and got merged before?

Do those linting errors now pop up because of some linter rule changes maybe? It will be an issue the next time somebody runs the code auto-generation again. So I guess manually fixing it should not be the solution.

@gaaclarke Might know.

@jmagman
Copy link
Member

jmagman commented Aug 17, 2020

@gaaclarke
Copy link
Member

I spawned an issue for the analysis issue: flutter/flutter#63966 Thanks =)

@cyanglaz
Copy link
Contributor

Offline discussion with @gaaclarke. We are ok with manually editing the auto-generated code to pass CI for now, and fix pigeon later.

@cyanglaz cyanglaz merged commit 77fbfcd into flutter:master Aug 17, 2020
@dnfield
Copy link
Contributor

dnfield commented Aug 17, 2020

Master started timing out after this commit. I'm going to take a quick look and see if reverting it resolves the timeout.

dnfield added a commit that referenced this pull request Aug 17, 2020
cyanglaz pushed a commit to cyanglaz/plugins that referenced this pull request Aug 18, 2020
cyanglaz pushed a commit that referenced this pull request Aug 18, 2020
@cyanglaz
Copy link
Contributor

@wwwdata This PR broke post submit ci. I reverted here #2938

cyanglaz pushed a commit that referenced this pull request Aug 18, 2020
@cyanglaz
Copy link
Contributor

Looks like this is not the cause of the time out. Relandded in #2939

cyanglaz pushed a commit that referenced this pull request Aug 18, 2020
jarrodcolburn pushed a commit to jarrodcolburn/plugins that referenced this pull request Aug 20, 2020
jarrodcolburn pushed a commit to jarrodcolburn/plugins that referenced this pull request Aug 20, 2020
jarrodcolburn pushed a commit to jarrodcolburn/plugins that referenced this pull request Aug 20, 2020
jorgefspereira pushed a commit to jorgefspereira/plugins_flutter that referenced this pull request Oct 10, 2020
jorgefspereira pushed a commit to jorgefspereira/plugins_flutter that referenced this pull request Oct 10, 2020
jorgefspereira pushed a commit to jorgefspereira/plugins_flutter that referenced this pull request Oct 10, 2020
@pedromassangocode
Copy link

Fixed flutter/flutter#66799 as well

FlutterSu pushed a commit to FlutterSu/flutter-plugins that referenced this pull request Nov 20, 2020
FlutterSu pushed a commit to FlutterSu/flutter-plugins that referenced this pull request Nov 20, 2020
FlutterSu pushed a commit to FlutterSu/flutter-plugins that referenced this pull request Nov 20, 2020
FlutterSu pushed a commit to tvip/flutter-plugins that referenced this pull request Mar 26, 2021
FlutterSu pushed a commit to tvip/flutter-plugins that referenced this pull request May 27, 2021
FlutterSu pushed a commit to tvip/flutter-plugins that referenced this pull request Jul 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[video_player] Videos without audio pauses music and can be stopped by the system
8 participants