androidx / androidx/media

Redirect URL domain works with Android Studio Emulator Stream but with the default demo App not Works on Google Tv Android 12

Open
#947 1 comment 0 reactions 1 assignee View on GitHub

@tianyif is already working on this.

Since Jan 8, 2024.

bug needs triage
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Version

Media3 1.2.0

More version details

First Of All Thanks for such a great Work. Second , Please kindly let me know that why when I use following stream as original works when I use it with demo application's Android Studio Emulator but not work with Google Tv Android 12 real hardware device? I mean when I run demo application with following url it redirect and works ok when using Android Studio Emulator, but when I try to use it with Demo Exoplayer Application it won't redirect the following url although it works perfectly fine with all other streams. so I would appreciate if you could write java code and show me which change I should do with Demo Java code in order to redirect following url too. here is the url :

here is the demo code which is unable to redirect above URL but it works with normal streaming (without redirection of url) please note as mentioned redirecting above url url when run it with Android Studio Emulator it works fine in the emulator Android 12 Google Tv X86 1080 . So I will appreciate if you could let me know which change should I do to demo code in order to play above url. Thanks. Please keep on great work. Happy New Year!

protected boolean initializePlayer() {
    if (player == null) {
      Intent intent = getIntent();

      mediaItems = createMediaItems(intent);
      if (mediaItems.isEmpty()) {
        return false;
      }

      lastSeenTracks = Tracks.EMPTY;
      ExoPlayer.Builder playerBuilder =
          new ExoPlayer.Builder(/* context= */ this)
              .setMediaSourceFactory(createMediaSourceFactory());
      setRenderersFactory(
          playerBuilder, intent.getBooleanExtra(IntentUtil.PREFER_EXTENSION_DECODERS_EXTRA, false));
      player = playerBuilder.build();
      player.setTrackSelectionParameters(trackSelectionParameters);
      player.addListener(new PlayerEventListener());
//      player.addAnalyticsListener(new EventLogger());
      player.setAudioAttributes(AudioAttributes.DEFAULT, /* handleAudioFocus= */ true);
      player.setPlayWhenReady(startAutoPlay);
      playerView.setPlayer(player);
      configurePlayerWithServerSideAdsLoader();
    }
    boolean haveStartPosition = startItemIndex != C.INDEX_UNSET;
    if (haveStartPosition) {
      player.seekTo(startItemIndex, startPosition);
    }
    player.setMediaItems(mediaItems, /* resetPosition= */ !haveStartPosition);
    player.prepare();
    updateButtonVisibility();
    return true;
  }



Devices that reproduce the issue

Android 12 Google Tv Chromecast (latest Firmware)

Devices that do not reproduce the issue

Android studio Emulator for Android 12 Google Tv

Reproducible in the demo app?

Yes

Reproduction steps
  1. copy above url in exolist.json file
  2. it works ok with emulator. but when run it with Real hardware device (Google Tv) the url is unable to load the playback. but it works perfectly fine in the Android Studio Emulator. here is the Android Studio info:

Android Studio Hedgehog | 2023.1.1 Patch 1
Build #AI-231.9392.1.2311.11255304, built on December 26, 2023
Runtime version: 17.0.7+0-17.0.7b1000.6-10550314 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.3
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 12
Metal Rendering is ON
Registry:
external.system.auto.import.disabled=true
debugger.new.tool.window.layout=true
ide.text.editor.with.preview.show.floating.toolbar=false
ide.experimental.ui=true

Expected result

the Expected result is in Real device would stream ok same as emulator. which is unable now

Actual result

url is unable to load the playback

Media

https://usher.ttvnw.net/api/channel/hls/itctv.m3u8?acmb=e30%3D&allow_source=true&browser_family=chrome&browser_version=120.0&cdm=wv&fast_bread=true&os_name=macOS&os_version=10.15.7&p=9723519&platform=web&play_session_id=568aa68726c6e65b71f9e6b6b2a15b07&player_backend=mediaplayer&player_version=1.24.0-rc.1.3&playlist_include_framerate=true&reassignments_supported=true&sig=fa8376d8b8c04a540a66eaf8354c34f41f8b2efa&supported_codecs=av1,h265,h264&token=%7B%22adblock%22%3Afalse%2C%22authorization%22%3A%7B%22forbidden%22%3Afalse%2C%22reason%22%3A%22%22%7D%2C%22blackout_enabled%22%3Afalse%2C%22channel%22%3A%22itctv%22%2C%22channel_id%22%3A893255638%2C%22chansub%22%3A%7B%22restricted_bitrates%22%3A%5B%5D%2C%22view_until%22%3A1924905600%7D%2C%22ci_gb%22%3Afalse%2C%22geoblock_reason%22%3A%22%22%2C%22device_id%22%3A%22989ca05a59a2e1a6%22%2C%22expires%22%3A1704660560%2C%22extended_history_allowed%22%3Afalse%2C%22game%22%3A%22%22%2C%22hide_ads%22%3Afalse%2C%22https_required%22%3Atrue%2C%22mature%22%3Afalse%2C%22partner%22%3Afalse%2C%22platform%22%3A%22web%22%2C%22player_type%22%3A%22embed%22%2C%22private%22%3A%7B%22allowed_to_view%22%3Atrue%7D%2C%22privileged%22%3Afalse%2C%22role%22%3A%22%22%2C%22server_ads%22%3Atrue%2C%22show_ads%22%3Atrue%2C%22subscriber%22%3Afalse%2C%22turbo%22%3Afalse%2C%22user_id%22%3Anull%2C%22user_ip%22%3A%2299.229.82.152%22%2C%22version%22%3A2%7D&transcode_mode=cbr_v1

P.S: I have updated above url as it was changed. in order to reproduce the issue you could get the Stream url from following website:
https://www.twitch.tv/itctv

Bug Report
  • You will email the zip file produced by adb bugreport to android-media-github@google.com after filing this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.