Skip to content

Commit b7886e5

Browse files
authored
Merge pull request #1 from nini22P/main
Update AGP to 8.2.0
2 parents b41cbfa + fcc0ed7 commit b7886e5

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

app/src/main/java/com/openwebgal/demo/MainActivity.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ class MainActivity : AppCompatActivity() {
213213
AudioManager.STREAM_MUSIC,
214214
AudioManager.AUDIOFOCUS_GAIN_TRANSIENT
215215
)
216+
// val pauseMediaScript =
217+
// "document.querySelectorAll('video, audio').forEach(mediaElement => mediaElement.pause())"
218+
// webView.evaluateJavascript(pauseMediaScript, null)
216219
webView.run {
217220
pauseTimers()
218221
onPause()
@@ -223,6 +226,15 @@ class MainActivity : AppCompatActivity() {
223226
//游戏从后台恢复
224227
override fun onResume() {
225228
audioManager?.abandonAudioFocus(null)
229+
// val resumeMediaScript =
230+
// "document.querySelectorAll('video, audio').forEach(mediaElement => {" +
231+
// "if((!mediaElement.loop && !mediaElement.ended) || mediaElement.loop) {" +
232+
// "if(mediaElement.readyState >= 2) {" +
233+
// "mediaElement.play()" +
234+
// "}" +
235+
// "}" +
236+
// "})"
237+
// webView.evaluateJavascript(resumeMediaScript, null)
226238
webView.run {
227239
resumeTimers()
228240
onResume()

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
plugins {
3-
id 'com.android.application' version '8.1.2' apply false
4-
id 'com.android.library' version '8.1.2' apply false
3+
id 'com.android.application' version '8.2.0' apply false
4+
id 'com.android.library' version '8.2.0' apply false
55
id 'org.jetbrains.kotlin.android' version '1.8.0' apply false
66
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Fri Feb 03 09:54:54 CST 2023
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)