Skip to content

Commit da20d47

Browse files
authored
[audioplayers] Update audioplayers (#406)
Add audioplayers_platform_interface dependency
1 parent 2bed8cb commit da20d47

33 files changed

+1200
-1134
lines changed

.github/recipe.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins:
2-
audioplayers: ["wearable-5.5"]
2+
audioplayers: ["wearable-5.5", "tv-6.5"]
33
battery_plus: ["wearable-5.5"]
44
connectivity_plus: ["wearable-5.5", "tv-6.5"]
55
device_info_plus: ["wearable-5.5", "tv-6.5"]

packages/audioplayers/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## 2.0.0
2+
3+
* Add audioplayers_platform_interface dependency and update method calls.
4+
* Add flame_lint dependency and update analysis_options.
5+
* Update audioplayers to 1.0.1.
6+
* Update example app and integration_test.
7+
* Update minimal sdk version to 2.14.0.
8+
* Update minimal flutter version to 2.5.0.
9+
* Update README.
10+
* (TV device) Fix seek to work on different playrates.
11+
* (TV device) Fix changing playrates at anytime during audio play.
12+
* (TV device) Fix not returning complete event when audio play finishes.
13+
114
## 1.1.0
215

316
* Update README and analysis_options.

packages/audioplayers/README.md

Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ This package is not an _endorsed_ implementation of `audioplayers`. Therefore, y
1010

1111
```yaml
1212
dependencies:
13-
audioplayers: ^0.20.1
14-
audioplayers_tizen: ^1.1.0
13+
audioplayers: ^1.0.1
14+
audioplayers_tizen: ^2.0.0
1515

1616
```
1717

@@ -43,8 +43,9 @@ For detailed information on Tizen privileges, see [Tizen Docs: API Privileges](h
4343

4444
## Supported APIs
4545

46-
- [x] `AudioPlayer.play` (supported arguments: `url`, `volume`, `position`)
47-
- [x] `AudioPlayer.playBytes` (supported arguments: `bytes`, `volume`, `position`)
46+
- [x] `AudioPlayer.play` (`AudioContext` not supported)
47+
- [ ] `AudioPlayer.setAudioContext` (not supported)
48+
- [x] `AudioPlayer.setPlayerMode`
4849
- [x] `AudioPlayer.pause`
4950
- [x] `AudioPlayer.stop`
5051
- [x] `AudioPlayer.resume`
@@ -53,40 +54,18 @@ For detailed information on Tizen privileges, see [Tizen Docs: API Privileges](h
5354
- [x] `AudioPlayer.setVolume`
5455
- [x] `AudioPlayer.setReleaseMode`
5556
- [x] `AudioPlayer.setPlaybackRate`
56-
- [x] `AudioPlayer.setUrl` (supported arguments: `url`)
57+
- [x] `AudioPlayer.setSource`
58+
- [x] `AudioPlayer.setSourceUrl`
59+
- [x] `AudioPlayer.setSourceDeviceFile`
60+
- [x] `AudioPlayer.setSourceAsset`
61+
- [x] `AudioPlayer.setSourceBytes`
5762
- [x] `AudioPlayer.getDuration`
5863
- [x] `AudioPlayer.getCurrentPosition`
5964
- [x] `AudioPlayer.dispose`
60-
- [ ] `AudioPlayer.earpieceOrSpeakersToggle` (not supported by Tizen)
61-
- [ ] `Logger.changeLogLevel` (not implemented)
62-
- [ ] `NotificationService` (iOS-only)
63-
64-
Note: In order to use the `AudioPlayer.playBytes` method, you need to manually modify the source code (`audioplayers.dart`) of your cached audioplayers package.
65-
66-
```dart
67-
Future<int> playBytes(
68-
Uint8List bytes, {
69-
...
70-
}) async {
71-
// Delete or comment out the following lines.
72-
// if (!_isAndroid()) {
73-
// throw PlatformException(
74-
// code: 'Not supported',
75-
// message: 'Only Android is currently supported',
76-
// );
77-
// }
78-
79-
final result = await _invokeMethod(
80-
'playBytes',
81-
<String, dynamic>{
82-
...
83-
}
84-
```
65+
- [ ] `AudioPlayer.global.changeLogLevel` (not supported)
66+
- [ ] `AudioPlayer.global.setGlobalAudioContext` (not supported)
8567

8668
## Limitations
8769

88-
This plugin has some limitations on TV devices.
89-
90-
- The `setPlaybackRate` method will fail if triggered within last 3 seconds.
91-
- The playback rate will reset to 1.0 when audio is replayed in loop mode.
92-
- The `seek` method works only when playback rate is 1.0, and it sets audio position to the nearest key frame which may differ from the passed argument.
70+
- `onPlayerComplete` event will not be fired when `ReleaseMode` is set to loop which differs from the behavior specified in the [documentation](https://pub.dev/documentation/audioplayers/latest/audioplayers/AudioPlayer/onPlayerComplete.html). And playback rate will reset to 1.0 when audio is replayed.
71+
- `setVolume` will have no effect on TV devices.
Lines changed: 1 addition & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -1,142 +1 @@
1-
# This file was copied from audioplayers/analysis_options.yaml (October 2021).
2-
3-
analyzer:
4-
strong-mode:
5-
implicit-casts: false
6-
implicit-dynamic: false
7-
8-
plugins:
9-
- dart_code_metrics
10-
11-
linter:
12-
rules:
13-
- always_declare_return_types
14-
- always_put_control_body_on_new_line
15-
- always_require_non_null_named_parameters
16-
- annotate_overrides
17-
- avoid_double_and_int_checks
18-
- avoid_dynamic_calls
19-
- avoid_empty_else
20-
- avoid_equals_and_hash_code_on_mutable_classes
21-
- avoid_escaping_inner_quotes
22-
- avoid_field_initializers_in_const_classes
23-
- avoid_init_to_null
24-
- avoid_js_rounded_ints
25-
- avoid_null_checks_in_equality_operators
26-
- avoid_private_typedef_functions
27-
- avoid_redundant_argument_values
28-
- avoid_relative_lib_imports
29-
- avoid_return_types_on_setters
30-
- avoid_shadowing_type_parameters
31-
- avoid_slow_async_io
32-
- avoid_type_to_string
33-
- avoid_types_as_parameter_names
34-
- avoid_unused_constructor_parameters
35-
- await_only_futures
36-
- camel_case_extensions
37-
- camel_case_types
38-
- cancel_subscriptions
39-
- cast_nullable_to_non_nullable
40-
- close_sinks
41-
- comment_references
42-
- constant_identifier_names
43-
- control_flow_in_finally
44-
- curly_braces_in_flow_control_structures
45-
- directives_ordering
46-
- do_not_use_environment
47-
- empty_catches
48-
- empty_constructor_bodies
49-
- empty_statements
50-
- exhaustive_cases
51-
- file_names
52-
- hash_and_equals
53-
- implementation_imports
54-
- invariant_booleans
55-
- iterable_contains_unrelated_type
56-
- join_return_with_assignment
57-
- library_names
58-
- library_prefixes
59-
- list_remove_unrelated_type
60-
- literal_only_boolean_expressions
61-
- missing_whitespace_between_adjacent_strings
62-
- no_adjacent_strings_in_list
63-
- no_duplicate_case_values
64-
- no_runtimeType_toString
65-
- omit_local_variable_types
66-
- package_api_docs
67-
- package_names
68-
- package_prefixed_library_names
69-
- parameter_assignments
70-
- prefer_adjacent_string_concatenation
71-
- prefer_asserts_in_initializer_lists
72-
- prefer_collection_literals
73-
- prefer_conditional_assignment
74-
- prefer_const_constructors
75-
- prefer_const_constructors_in_immutables
76-
- prefer_const_declarations
77-
- prefer_const_literals_to_create_immutables
78-
- prefer_contains
79-
- prefer_equal_for_default_values
80-
- prefer_final_fields
81-
- prefer_final_in_for_each
82-
- prefer_final_locals
83-
- prefer_for_elements_to_map_fromIterable
84-
- prefer_foreach
85-
- prefer_function_declarations_over_variables
86-
- prefer_generic_function_type_aliases
87-
- prefer_if_elements_to_conditional_expressions
88-
- prefer_if_null_operators
89-
- prefer_initializing_formals
90-
- prefer_inlined_adds
91-
- prefer_interpolation_to_compose_strings
92-
- prefer_is_empty
93-
- prefer_is_not_empty
94-
- prefer_is_not_operator
95-
- prefer_iterable_whereType
96-
- prefer_mixin
97-
- prefer_null_aware_operators
98-
- prefer_single_quotes
99-
- prefer_spread_collections
100-
- prefer_relative_imports
101-
- prefer_typing_uninitialized_variables
102-
- prefer_void_to_null
103-
- provide_deprecation_message
104-
- recursive_getters
105-
- slash_for_doc_comments
106-
- sort_unnamed_constructors_first
107-
- test_types_in_equals
108-
- throw_in_finally
109-
- type_annotate_public_apis
110-
- type_init_formals
111-
- unnecessary_await_in_return
112-
- unnecessary_brace_in_string_interps
113-
- unnecessary_const
114-
- unnecessary_getters_setters
115-
- unnecessary_lambdas
116-
- unnecessary_new
117-
- unnecessary_null_aware_assignments
118-
- unnecessary_null_in_if_null_operators
119-
- unnecessary_overrides
120-
- unnecessary_parenthesis
121-
- unnecessary_raw_strings
122-
- unnecessary_statements
123-
- unnecessary_string_escapes
124-
- unnecessary_string_interpolations
125-
- unnecessary_this
126-
- use_full_hex_values_for_flutter_colors
127-
- use_function_type_syntax_for_parameters
128-
- use_is_even_rather_than_modulo
129-
- use_rethrow_when_possible
130-
- unrelated_type_equality_checks
131-
- unsafe_html
132-
- void_checks
133-
134-
dart_code_metrics:
135-
rules:
136-
- prefer-trailing-comma
137-
- prefer-trailing-comma-for-collection
138-
- no-equal-then-else
139-
- no-object-declaration
140-
- potential-null-dereference
141-
metrics-exclude:
142-
- '**/**'
1+
include: package:flame_lint/analysis_options.yaml
-59.6 KB
Binary file not shown.
-2.81 MB
Binary file not shown.
301 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)