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

[video_player] Playback speed #3084

Conversation

creativecreatorormaybenot
Copy link
Contributor

@creativecreatorormaybenot
Copy link
Contributor Author

@ditman Can you make sure that #3031, #1400, #860, flutter/flutter#29900, and flutter/flutter#16624 are closed after this is merged? 🎉

Copy link
Member

@ditman ditman left a comment

Choose a reason for hiding this comment

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

Thanks for taking the time to revive this! Let's merge once _web is ready, and CI passes here!

@ditman
Copy link
Member

ditman commented Sep 26, 2020

There's a bunch of warnings that seem legit:

    - WARN  | [iOS] xcodebuild:  /private/var/folders/3y/l0z1x3693dl_8n0qybp4dqwh0000gn/T/cirrus-ci-build/packages/video_player/video_player/ios/Classes/messages.m:63: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:115: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:116: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:136: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:137: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:156: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:157: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:176: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:177: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:193: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

(I'll restart the test just in case)

@ditman ditman merged commit f778027 into flutter:master Sep 26, 2020
@ditman
Copy link
Member

ditman commented Sep 26, 2020

Published video_player v0.11.0, which contains the playback speed feature!

jorgefspereira pushed a commit to jorgefspereira/plugins_flutter that referenced this pull request Oct 10, 2020
details:nil]);
}
return;
}

Choose a reason for hiding this comment

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

I know this PR already merged, but just wanted to bring attention to the fact that the video_player dart code is not built to handle errors properly after initialization.

If someone tries to set the playback speed after the video player has already been initialized, and this sends a flutter error, the video player controller in dart will wipe all its information, including its size, causing exceptions and the video to disappear.

void errorListener(Object obj) {
      final PlatformException e = obj;
      value = VideoPlayerValue.erroneous(e.message);   <======= This is the problem after it's already been initialized
      _timer?.cancel();
      if (!initializingCompleter.isCompleted) {
        initializingCompleter.completeError(obj);
      }
    }

Copy link
Member

Choose a reason for hiding this comment

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

@dannyvalentesonos can you create a new issue for this? That way more people than whoever participated in this PR will see it!

(Please select the "p:video_player" tag, or start the issue with "[video_player]" so the triage knows it's a plugins issue.)

Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What other behavior would you expect, though?

Copy link

Choose a reason for hiding this comment

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

Sending an error to dart is totally acceptable. Nulling out the size so the video is no longer shown though isn't so great.

Choose a reason for hiding this comment

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

I've created flutter/flutter#68914. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
4 participants