-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[video_player_web] migrates to package:web #5800
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
Merged
auto-submit
merged 24 commits into
flutter:main
from
balvinderz:migrate_video_player_web_to_package_web
Mar 6, 2024
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
76c9178
migrate to package:web'
balvinderz ee17974
fix tests
balvinderz aca2d65
Merge branch 'main' into migrate_video_player_web_to_package_web
balvinderz 613edb8
Merge branch 'main' into migrate_video_player_web_to_package_web
balvinderz d99e782
Merge branch 'main' into migrate_video_player_web_to_package_web
balvinderz b6ebf4d
Merge branch 'main' into migrate_video_player_web_to_package_web
balvinderz db93947
Merge branch 'main' into migrate_video_player_web_to_package_web
balvinderz cff2dad
Merge branch 'main' into migrate_video_player_web_to_package_web
balvinderz 52711d8
Merge branch 'main' into migrate_video_player_web_to_package_web
balvinderz ddb7c8c
Merge branch 'main' into migrate_video_player_web_to_package_web
balvinderz d930659
Merge branch 'main' into migrate_video_player_web_to_package_web
balvinderz b66ad37
Merge branch 'main' into migrate_video_player_web_to_package_web
ditman 2a6f7bf
Ensure web 0.5.0 everywhere. Update some syntax.
ditman 54fa27e
Address some additional PR comments.
ditman dcfdd7f
Comment some public integration_test utils.
ditman 66fac4b
Incorporate #5920
ditman 0df1bc7
Move all js-interop code together.
ditman 46de6a4
Fix version in pubspec
ditman 529e718
Merge branch 'main' into migrate_video_player_web_to_package_web
ditman c898c83
Use HTMLElement constructors from web 0.5.1
ditman 66a9db2
Format
ditman 9b02258
Improves JS-interop for defineProperty.
ditman 06fab2e
Consolidated extension types.
ditman 2ba0a9c
Use web 0.5.1 for test app too.
ditman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
packages/video_player/video_player_web/example/integration_test/pkg_web_tweaks.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
@JS() | ||
library video_player_web_integration_test_pkg_web_tweaks; | ||
|
||
import 'dart:js_interop'; | ||
import 'package:web/web.dart' as web; | ||
|
||
/// Adds a `controlsList` and `disablePictureInPicture` getters. | ||
extension NonStandardGettersOnVideoElement on web.HTMLVideoElement { | ||
external web.DOMTokenList? get controlsList; | ||
external JSBoolean get disablePictureInPicture; | ||
} | ||
|
||
/// Adds a `disableRemotePlayback` getter. | ||
extension NonStandardGettersOnMediaElement on web.HTMLMediaElement { | ||
external JSBoolean get disableRemotePlayback; | ||
} | ||
|
||
/// Defines JS interop to access static methods from `Object`. | ||
@JS('Object') | ||
extension type DomObject._(JSAny _) { | ||
@JS('defineProperty') | ||
external static void _defineProperty( | ||
JSAny? object, JSString property, Descriptor value); | ||
|
||
/// `Object.defineProperty`. | ||
/// | ||
/// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty | ||
static void defineProperty( | ||
JSObject object, String property, Descriptor descriptor) { | ||
return _defineProperty(object, property.toJS, descriptor); | ||
} | ||
} | ||
|
||
/// The descriptor for the property being defined or modified with `defineProperty`. | ||
/// | ||
/// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#description | ||
extension type Descriptor._(JSObject _) implements JSObject { | ||
/// Builds a "data descriptor". | ||
factory Descriptor.data({ | ||
bool? writable, | ||
JSAny? value, | ||
}) => | ||
Descriptor._data( | ||
writable: writable?.toJS, | ||
value: value.jsify(), | ||
); | ||
|
||
/// Builds an "accessor descriptor". | ||
factory Descriptor.accessor({ | ||
void Function(JSAny? value)? set, | ||
JSAny? Function()? get, | ||
}) => | ||
Descriptor._accessor( | ||
set: set?.toJS, | ||
get: get?.toJS, | ||
); | ||
|
||
external factory Descriptor._accessor({ | ||
// JSBoolean configurable, | ||
// JSBoolean enumerable, | ||
JSFunction? set, | ||
JSFunction? get, | ||
}); | ||
|
||
external factory Descriptor._data({ | ||
// JSBoolean configurable, | ||
// JSBoolean enumerable, | ||
JSBoolean? writable, | ||
JSAny? value, | ||
}); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.