diff --git a/flutter_music_player/ohos/.gitignore b/flutter_music_player/ohos/.gitignore index 6df8a46a85b23a1e04f720f64da9760a1066b656..f05e09ed06fe5780e94173ac92fb02415b801c7c 100644 --- a/flutter_music_player/ohos/.gitignore +++ b/flutter_music_player/ohos/.gitignore @@ -9,4 +9,9 @@ /.clang-format /.clang-tidy **/.test -/har/flutter_embedding.har \ No newline at end of file +/har/flutter_embedding.har +entry/libs/arm64-v8a/libapp.so +entry/libs/arm64-v8a/libflutter.so +entry/libs/arm64-v8a/libvmservice_snapshot.so +entry/src/main/resources/rawfile/flutter_assets/ +/oh-package-lock.json5 \ No newline at end of file diff --git a/flutter_music_player/ohos/build-profile.json5 b/flutter_music_player/ohos/build-profile.json5 index 26733084878869ff8adf5e2c3bae5e8339978508..e8c7d7eb0de5e1a65194730cc12e2a4c3d3e4a92 100644 --- a/flutter_music_player/ohos/build-profile.json5 +++ b/flutter_music_player/ohos/build-profile.json5 @@ -20,8 +20,8 @@ { "name": "default", "signingConfig": "default", - "compileSdkVersion": "4.0.0(10)", - "compatibleSdkVersion": "4.0.0(10)", + "compileSdkVersion": "4.1.0(11)", + "compatibleSdkVersion": "4.1.0(11)", "runtimeOS": "HarmonyOS", } ] diff --git a/flutter_music_player/ohos/dependencies/hvigor-3.0.9-s.tgz b/flutter_music_player/ohos/dependencies/hvigor-3.1.0-s.tgz similarity index 61% rename from flutter_music_player/ohos/dependencies/hvigor-3.0.9-s.tgz rename to flutter_music_player/ohos/dependencies/hvigor-3.1.0-s.tgz index 65b0d24f94d2aecc1099f8f8220beec695bfb779..db5e00ee455145d45b7f4bc2a708559b6c2d1413 100644 Binary files a/flutter_music_player/ohos/dependencies/hvigor-3.0.9-s.tgz and b/flutter_music_player/ohos/dependencies/hvigor-3.1.0-s.tgz differ diff --git a/flutter_music_player/ohos/dependencies/hvigor-ohos-arkui-x-plugin-2.1.7-s.tgz b/flutter_music_player/ohos/dependencies/hvigor-ohos-arkui-x-plugin-2.1.7-s.tgz deleted file mode 100644 index 233a449cbfef6be702d861744254dd89ce633fb7..0000000000000000000000000000000000000000 Binary files a/flutter_music_player/ohos/dependencies/hvigor-ohos-arkui-x-plugin-2.1.7-s.tgz and /dev/null differ diff --git a/flutter_music_player/ohos/dependencies/hvigor-ohos-plugin-3.0.9-s.tgz b/flutter_music_player/ohos/dependencies/hvigor-ohos-plugin-3.1.0-s.tgz similarity index 44% rename from flutter_music_player/ohos/dependencies/hvigor-ohos-plugin-3.0.9-s.tgz rename to flutter_music_player/ohos/dependencies/hvigor-ohos-plugin-3.1.0-s.tgz index e2e499e18dfcd05e1e275579d11697640eb80323..2d50659b9337bd217434a62e8af619ffea7c0120 100644 Binary files a/flutter_music_player/ohos/dependencies/hvigor-ohos-plugin-3.0.9-s.tgz and b/flutter_music_player/ohos/dependencies/hvigor-ohos-plugin-3.1.0-s.tgz differ diff --git a/flutter_music_player/ohos/dependencies/rollup.tgz b/flutter_music_player/ohos/dependencies/rollup.tgz deleted file mode 100644 index b224a37a5f69fd22f58c7a28151742eafe7e6317..0000000000000000000000000000000000000000 Binary files a/flutter_music_player/ohos/dependencies/rollup.tgz and /dev/null differ diff --git a/flutter_music_player/ohos/entry/libs/arm64-v8a/libflutter.so b/flutter_music_player/ohos/entry/libs/arm64-v8a/libflutter.so deleted file mode 100755 index 04aaf444e4c73c52023c5eb4429d54a412e58833..0000000000000000000000000000000000000000 Binary files a/flutter_music_player/ohos/entry/libs/arm64-v8a/libflutter.so and /dev/null differ diff --git a/flutter_music_player/ohos/entry/src/main/ets/entryability/EntryAbility.ets b/flutter_music_player/ohos/entry/src/main/ets/entryability/EntryAbility.ets index 44639932c978c8eb3854e9156ae1e470e895232d..4f93910c4ae1ac5a93db23eaee63cd0a35a9b356 100644 --- a/flutter_music_player/ohos/entry/src/main/ets/entryability/EntryAbility.ets +++ b/flutter_music_player/ohos/entry/src/main/ets/entryability/EntryAbility.ets @@ -15,10 +15,11 @@ import { FlutterAbility } from '@ohos/flutter_ohos'; import AVPlayerPlugin from '../plugin/AVPlayerPlugin'; +import FlutterEngine from '@ohos/flutter_ohos/src/main/ets/embedding/engine/FlutterEngine'; export default class EntryAbility extends FlutterAbility { - onFlutterEngineReady(): void { - super.onFlutterEngineReady(); + configureFlutterEngine(flutterEngine: FlutterEngine) { + super.configureFlutterEngine(flutterEngine); this.addPlugin(new AVPlayerPlugin()); } } diff --git a/flutter_music_player/ohos/entry/src/main/ets/pages/Index.ets b/flutter_music_player/ohos/entry/src/main/ets/pages/Index.ets index d784c75ed9d16a6657bb6466a148752b1b20bd91..1125f9fdd95f4310a182c1c9e3680f37f73686c9 100644 --- a/flutter_music_player/ohos/entry/src/main/ets/pages/Index.ets +++ b/flutter_music_player/ohos/entry/src/main/ets/pages/Index.ets @@ -13,14 +13,26 @@ * limitations under the License. */ +import common from '@ohos.app.ability.common'; import { FlutterPage } from '@ohos/flutter_ohos' -@Entry +let storage = LocalStorage.getShared() +const EVENT_BACK_PRESS = 'EVENT_BACK_PRESS' + +@Entry(storage) @Component struct Index { + private context = getContext(this) as common.UIAbilityContext + @LocalStorageLink('viewId') viewId: string = ""; + build() { Column() { - FlutterPage() + FlutterPage({ viewId: this.viewId }) } } + + onBackPress(): boolean { + this.context.eventHub.emit(EVENT_BACK_PRESS) + return true + } } \ No newline at end of file diff --git a/flutter_music_player/ohos/entry/src/main/ets/plugins/GeneratedPluginRegistrant.ets b/flutter_music_player/ohos/entry/src/main/ets/plugins/GeneratedPluginRegistrant.ets new file mode 100644 index 0000000000000000000000000000000000000000..2131f1f507fed5a6cf54e398e6a66179ee99e27e --- /dev/null +++ b/flutter_music_player/ohos/entry/src/main/ets/plugins/GeneratedPluginRegistrant.ets @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +import { FlutterPlugin } from '@ohos/flutter_ohos/src/main/ets/embedding/engine/plugins/FlutterPlugin'; +import List from '@ohos.util.List'; + +/** + * Generated file. Do not edit. + * This file is generated by the Flutter tool based on the + * plugins that support the Ohos platform. + */ +export class GeneratedPluginRegistrant { + static getPlugins(): List { + let pluginList : List = new List(); + return pluginList; + } +} diff --git a/flutter_music_player/ohos/hvigor/hvigor-config.json5 b/flutter_music_player/ohos/hvigor/hvigor-config.json5 index 0675e04dd09ab349dcc8cab2ff11f12187c6f26b..1b90ea24c97254582d5ef7f554fe798da84ed3a9 100644 --- a/flutter_music_player/ohos/hvigor/hvigor-config.json5 +++ b/flutter_music_player/ohos/hvigor/hvigor-config.json5 @@ -14,9 +14,8 @@ */ { - "hvigorVersion": "file:../dependencies/hvigor-3.0.9-s.tgz", + "hvigorVersion": "file:../dependencies/hvigor-3.1.0-s.tgz", "dependencies": { - "@ohos/hvigor-ohos-plugin": "file:../dependencies/hvigor-ohos-plugin-3.0.9-s.tgz", - "rollup": "file:../dependencies/rollup.tgz", + "@ohos/hvigor-ohos-plugin": "file:../dependencies/hvigor-ohos-plugin-3.1.0-s.tgz", } } \ No newline at end of file