diff --git a/DisneyPlayer/app/build.gradle b/DisneyPlayer/app/build.gradle deleted file mode 100644 index 6845bda..0000000 --- a/DisneyPlayer/app/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -apply plugin: 'com.android.application' - -android { - namespace "com.disneyplayer" - compileSdk 35 - - defaultConfig { - applicationId "com.disneyplayer" - minSdk 21 - targetSdk 35 - versionCode 1 - versionName "1.0" - } - - buildTypes { - release { - minifyEnabled false - } - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } -} - -dependencies { - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'org.videolan.android:libvlc-all:3.6.0-eap9' - implementation 'com.squareup.okhttp3:okhttp:4.12.0' -} diff --git a/DisneyPlayer/app/src/main/AndroidManifest.xml b/DisneyPlayer/app/src/main/AndroidManifest.xml deleted file mode 100644 index 821a672..0000000 --- a/DisneyPlayer/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/DisneyPlayer/app/src/main/java/com/disneyplayer/MainActivity.java b/DisneyPlayer/app/src/main/java/com/disneyplayer/MainActivity.java deleted file mode 100644 index be1fa43..0000000 --- a/DisneyPlayer/app/src/main/java/com/disneyplayer/MainActivity.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.disneyplayer; - -import android.app.Activity; -import android.net.Uri; -import android.os.Bundle; -import android.os.Handler; -import android.os.Looper; -import android.view.SurfaceView; -import android.view.View; -import android.widget.Button; -import android.widget.LinearLayout; -import android.widget.ProgressBar; -import android.widget.Toast; -import android.widget.TextView; - -import org.videolan.libvlc.LibVLC; -import org.videolan.libvlc.Media; -import org.videolan.libvlc.MediaPlayer; -import org.videolan.libvlc.interfaces.IVLCVout; - -import java.util.ArrayList; - -public class MainActivity extends Activity { - - private SurfaceView surfaceView; - private ProgressBar progressBar; - private Button playButton; - private TextView statusText; - private LibVLC libVlc; - private MediaPlayer mediaPlayer; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - // Create layout programmatically - LinearLayout layout = new LinearLayout(this); - layout.setOrientation(LinearLayout.VERTICAL); - layout.setGravity(android.view.Gravity.CENTER); - - statusText = new TextView(this); - statusText.setText("Disney Player Ready"); - statusText.setTextSize(18); - statusText.setPadding(20, 20, 20, 20); - - playButton = new Button(this); - playButton.setText("▶ Reproducir Disney+"); - playButton.setTextSize(18); - playButton.setPadding(40, 40, 40, 40); - - progressBar = new ProgressBar(this); - progressBar.setVisibility(View.GONE); - - surfaceView = new SurfaceView(this); - surfaceView.setVisibility(View.GONE); - LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( - LinearLayout.LayoutParams.MATCH_PARENT, - 0 - ); - params.weight = 1; - surfaceView.setLayoutParams(params); - - layout.addView(statusText); - layout.addView(progressBar); - layout.addView(playButton); - layout.addView(surfaceView); - - setContentView(layout); - - Toast.makeText(this, "App iniciada correctamente", Toast.LENGTH_LONG).show(); - - playButton.setOnClickListener(v -> { - Toast.makeText(this, "Botón presionado", Toast.LENGTH_SHORT).show(); - playButton.setEnabled(false); - progressBar.setVisibility(View.VISIBLE); - statusText.setText("Iniciando reproducción..."); - - new Thread(() -> { - try { - String streamUrl = "https://live-ftc-sa-east-2.media.dssott.com/dvt2=exp=1772064227~url=%2Fgru1%2Fva01%2Fdisneyplus%2Fevent%2F2026%2F02%2F25%2FIndependiente_Medellin_CO_20260225_1771970452022%2F~psid=17da5759-0dba-4eb5-9375-616e2a1b1443~aid=71e116db-825e-477c-b3f4-df5d3f2c8923~did=2e11e811-1ed0-4193-859b-5c4ff40a44c5~country=AR~kid=k02~hmac=9da7486b6390fbbef9a9bf47aac4a6b18fe424f1d0c3c6c8623cf2785e74c60f/gru1/va01/disneyplus/event/2026/02/25/Independiente_Medellin_CO_20260225_1771970452022/ctr-all-hdri-complete.m3u8"; - String drmKeyId = "4f37dd7a0f4d41b5947f627c0efcf654"; - String drmKey = "01987a05f2f3ab9b0e245a4f1b36474e"; - - Thread.sleep(500); // Small delay to show the toast - runOnUiThread(() -> startPlayback(streamUrl, drmKeyId, drmKey)); - } catch (Exception e) { - runOnUiThread(() -> { - Toast.makeText(this, "Error: " + e.getMessage(), Toast.LENGTH_LONG).show(); - playButton.setEnabled(true); - progressBar.setVisibility(View.GONE); - }); - } - }).start(); - }); - } - - private void startPlayback(String streamUrl, String drmKeyId, String drmKey) { - try { - releasePlayer(); - - ArrayList options = new ArrayList<>(); - options.add("--network-caching=3000"); - options.add(":no-cert-check"); - options.add(":demux=avformat"); - options.add(":key-format=org.w3.clearkey"); - options.add(":key=" + drmKeyId + ":" + drmKey); - options.add(":http-user-agent=Mozilla/5.0 (Linux; Android 13) AppleWebKit/537.36"); - options.add(":http-referrer=https://sudamericaplay.com/"); - - libVlc = new LibVLC(this, options); - mediaPlayer = new MediaPlayer(libVlc); - - final Handler mainHandler = new Handler(Looper.getMainLooper()); - - mediaPlayer.setEventListener(new MediaPlayer.EventListener() { - @Override - public void onEvent(MediaPlayer.Event event) { - mainHandler.post(() -> { - switch (event.type) { - case MediaPlayer.Event.Playing: - statusText.setText("Reproduciendo..."); - progressBar.setVisibility(View.GONE); - surfaceView.setVisibility(View.VISIBLE); - Toast.makeText(MainActivity.this, "Video iniciado", Toast.LENGTH_SHORT).show(); - break; - - case MediaPlayer.Event.EncounteredError: - statusText.setText("Error de reproducción"); - progressBar.setVisibility(View.GONE); - Toast.makeText(MainActivity.this, "Error al reproducir", Toast.LENGTH_LONG).show(); - playButton.setEnabled(true); - break; - - case MediaPlayer.Event.EndReached: - statusText.setText("Video terminado"); - break; - - case MediaPlayer.Event.Buffering: - float buffer = event.getBuffering(); - if (buffer < 1.0f) { - statusText.setText("Buffering: " + (int)(buffer * 100) + "%"); - } else { - statusText.setText("Reproduciendo..."); - } - break; - } - }); - } - }); - - Media media = new Media(libVlc, Uri.parse(streamUrl)); - mediaPlayer.setMedia(media); - media.release(); - - IVLCVout vout = mediaPlayer.getVLCVout(); - vout.setVideoView(surfaceView); - vout.attachViews(); - - mediaPlayer.play(); - - } catch (Exception e) { - Toast.makeText(this, "Error: " + e.getMessage(), Toast.LENGTH_LONG).show(); - playButton.setEnabled(true); - progressBar.setVisibility(View.GONE); - } - } - - private void releasePlayer() { - if (mediaPlayer != null) { - mediaPlayer.stop(); - mediaPlayer.getVLCVout().detachViews(); - mediaPlayer.release(); - mediaPlayer = null; - } - if (libVlc != null) { - libVlc.release(); - libVlc = null; - } - } - - @Override - protected void onDestroy() { - super.onDestroy(); - releasePlayer(); - } -} diff --git a/DisneyPlayer/app/src/main/res/layout/activity_main.xml b/DisneyPlayer/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index e6f7738..0000000 --- a/DisneyPlayer/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - -