Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 18, 2025

Media3 1.9.0 deprecated several Player.Listener and surface APIs. This PR updates the affected code in gsyVideoPlayer-exo_player2 and app modules.

API Updates

Player.Listener interface changes:

  • onCues(List<Cue>)onCues(CueGroup) - 3 files updated
  • Removed deprecated onMetadata(Metadata) from Player.Listener (retained in MetadataOutput/AnalyticsListener) - 2 files updated

Surface API:

  • PlaceholderSurface.newInstance()PlaceholderSurface.newInstanceV17() - 1 file updated

Example

// Before
@Override
public void onCues(List<Cue> cues) {
    super.onCues(cues);
}

@Override  
public void onMetadata(Metadata metadata) {
    // From deprecated Player.Listener
}

// After
@Override
public void onCues(CueGroup cueGroup) {
    super.onCues(cueGroup);
}

// onMetadata removed from Player.Listener implementations
// (kept in MetadataOutput/AnalyticsListener where not deprecated)

Files Modified

  • gsyVideoPlayer-exo_player2/Exo2PlayerManager.java
  • gsyVideoPlayer-exo_player2/IjkExo2MediaPlayer.java
  • gsyVideoPlayer-exo_player2/demo/EventLogger.java
  • app/exosubtitle/GSYExoSubTitlePlayer.java

Not Changed

ConcatenatingMediaSource in app/exo/GSYExo2MediaPlayer.java - deprecated but functional. Alternative implementation already documented in comments (lines 90-99).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -XX:&#43;UseParallelGC --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx4g -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.7-bin/bhs2wmbdwecv87pi65oeuq5iu/gradle-8.7/lib/gradle-launcher-8.7.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.7-bin/bhs2wmbdwecv87pi65oeuq5iu/gradle-8.7/lib/agents/gradle-instrumentation-agent-8.7.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.7 (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -XX:&#43;UseParallelGC --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx4g -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.7-bin/bhs2wmbdwecv87pi65oeuq5iu/gradle-8.7/lib/gradle-launcher-8.7.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.7-bin/bhs2wmbdwecv87pi65oeuq5iu/gradle-8.7/lib/agents/gradle-instrumentation-agent-8.7.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.7 grep (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

现在的 media 版本是 1.9.0 了,帮我看看 @gsyVideoPlayer-exo_player2 和 @app 下的 media 使用,有哪些过期 API 需要处理和升级,主要,只修改对应区域的代码,不要格式化原有代码,带来不必要的审核成本


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Dec 18, 2025
… app modules

Co-authored-by: CarGuo <10770362+CarGuo@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix deprecated APIs in media version 1.9.0 Update deprecated Media3 1.9.0 APIs in gsyVideoPlayer-exo_player2 and app modules Dec 18, 2025
Copilot AI requested a review from CarGuo December 18, 2025 02:35
@CarGuo CarGuo marked this pull request as ready for review December 18, 2025 03:31
Copilot AI review requested due to automatic review settings December 18, 2025 03:31
@CarGuo CarGuo merged commit 413ca70 into master Dec 18, 2025
6 checks passed
@CarGuo CarGuo deleted the copilot/remove-deprecated-apis-media branch December 18, 2025 03:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the gsyVideoPlayer codebase to address deprecated APIs in Media3 1.9.0, focusing on Player.Listener interface changes and surface-related APIs. The changes are minimal and targeted, updating only the necessary code areas without reformatting existing code, which keeps the review focused and manageable.

Key changes:

  • Updated onCues(List<Cue>) to onCues(CueGroup) in Player.Listener implementations
  • Removed deprecated onMetadata(Metadata) from Player.Listener implementations (retained in AnalyticsListener and MetadataOutput where not deprecated)
  • Updated PlaceholderSurface.newInstance() to PlaceholderSurface.newInstanceV17()

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
gsyVideoPlayer-exo_player2/src/main/java/tv/danmaku/ijk/media/exo2/demo/EventLogger.java Updated onCues signature from List<Cue> to CueGroup and added CueGroup import
gsyVideoPlayer-exo_player2/src/main/java/tv/danmaku/ijk/media/exo2/IjkExo2MediaPlayer.java Updated onCues signature and removed deprecated onMetadata from Player.Listener implementation, added CueGroup import
gsyVideoPlayer-exo_player2/src/main/java/tv/danmaku/ijk/media/exo2/Exo2PlayerManager.java Updated PlaceholderSurface instantiation from newInstance() to newInstanceV17()
app/src/main/java/com/example/gsyvideoplayer/exosubtitle/GSYExoSubTitlePlayer.java Updated onCues signature and removed deprecated onMetadata, added CueGroup import

Review Summary: All changes are correct and properly handle the Media3 1.9.0 API deprecations. The PR correctly distinguishes between onMetadata(Metadata) deprecated in Player.Listener versus the non-deprecated versions in AnalyticsListener and MetadataOutput. The CueGroup parameter can be accessed via its .cues field when needed (as demonstrated in GSYExoSubTitleVideoView). No issues found.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants