Skip to content

Commit

Permalink
Stuck on player playback bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkordic committed Aug 28, 2023
1 parent 9c06e95 commit f4aa22f
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 101 deletions.
51 changes: 1 addition & 50 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,8 @@ android {
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.support.test.runner.AndroidJUnitRunner"

<<<<<<< Updated upstream
manifestPlaceholders.theoLicense = "YOUR_THEOPLAYER_LICENSE_HERE"
manifestPlaceholders.theoLicense = "${theo_licence}"
}
=======
manifestPlaceholders.theoLicense = "${theo_licence}"
}
>>>>>>> Stashed changes


buildTypes {
Expand All @@ -37,26 +31,6 @@ android {
}
}
sourceSets {
minapi16 {
java.srcDirs = ["./src/no_ads/java"]
res.srcDirs = ["./src/no_ads/res"]
assets.srcDirs = ["./src/no_ads/assets"]
}
minapi21 {
java.srcDirs = ["./src/no_ads/java"]
res.srcDirs = ["./src/no_ads/res"]
assets.srcDirs = ["./src/no_ads/assets"]
}
minapi16ads {
java.srcDirs = ["./src/ads/java"]
res.srcDirs = ["./src/ads/res"]
assets.srcDirs = ["./src/ads/assets"]
}
minapi21ads {
java.srcDirs = ["./src/ads/java"]
res.srcDirs = ["./src/ads/res"]
assets.srcDirs = ["./src/ads/assets"]
}
v5 {
java.srcDirs = ["./src/no_ads/java"]
res.srcDirs = ["./src/no_ads/res"]
Expand All @@ -67,20 +41,6 @@ android {
flavorDimensions "api"

productFlavors {
minapi16 {
dimension "api"
}
minapi21 {
dimension "api"
minSdkVersion 21
}
minapi16ads {
dimension "api"
}
minapi21ads {
dimension "api"
minSdkVersion 21
}
v5 {
dimension 'api'
minSdkVersion 21
Expand All @@ -106,16 +66,7 @@ dependencies {
api "org.checkerframework:checker-qual:3.32.0"
implementation project(":muxstatssdktheoplayer")

minapi16adsImplementation files("../common_libs/theoplayer-android-dist-56d3a9e5-4252-4bca-b650-180c8f16ce52-2.80.0-minapi16-release.aar")
minapi21adsImplementation files("../common_libs/theoplayer-android-dist-56d3a9e5-4252-4bca-b650-180c8f16ce52-2.80.0-minapi21-release.aar")
minapi16Implementation files("../common_libs/theoplayer-android-dist-56d3a9e5-4252-4bca-b650-180c8f16ce52-2.80.0-minapi16-release.aar")
minapi21Implementation files("../common_libs/theoplayer-android-dist-56d3a9e5-4252-4bca-b650-180c8f16ce52-2.80.0-minapi21-release.aar")

implementation "com.google.code.gson:gson:2.9.1"
implementation "androidx.constraintlayout:constraintlayout:2.2.0-alpha09"
implementation "androidx.appcompat:appcompat:1.6.1"
minapi16adsImplementation "com.google.ads.interactivemedia.v3:interactivemedia:3.30.0"
minapi16adsImplementation "com.google.android.gms:play-services-ads-identifier:18.0.1"
minapi21adsImplementation "com.google.ads.interactivemedia.v3:interactivemedia:3.30.0"
minapi21adsImplementation "com.google.android.gms:play-services-ads-identifier:18.0.1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.theoplayer.android.api.event.player.PlayerEventTypes;
import com.theoplayer.android.api.player.Player;
import com.theoplayer.android.api.source.SourceDescription;
import com.theoplayer.android.api.source.SourceType;
import com.theoplayer.android.api.source.TypedSource;

public class MainActivity extends AppCompatActivity {
Expand Down Expand Up @@ -85,7 +86,10 @@ private void configureTHEOplayer() {
theoPlayerView.getSettings().setFullScreenOrientationCoupled(true);

// Creating a TypedSource builder that defines the location of a single stream source.
TypedSource.Builder typedSource = new TypedSource.Builder(getString(R.string.defaultSourceUrl));
// TypedSource.Builder typedSource = new TypedSource.Builder(getString(R.string.defaultSourceUrl));
TypedSource.Builder typedSource = new TypedSource.Builder("http://192.168.1.121:8000/playlist.mpd");

typedSource.type(SourceType.DASH);

// Creating a SourceDescription builder that contains the settings to be applied as a new
// THEOplayer source.
Expand All @@ -95,6 +99,7 @@ private void configureTHEOplayer() {

// Configuring THEOplayer with defined SourceDescription object.
theoPlayer.setSource(sourceDescription.build());
theoPlayer.setAutoplay(true);

theoPlayer.addEventListener(PlayerEventTypes.PLAYING, event ->
txtPlayStatus.setText("Playing")
Expand Down
22 changes: 1 addition & 21 deletions automatedtests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ android {
testInstrumentationRunnerArguments clearPackageData: "true"

buildConfigField("boolean", "SHOULD_REPORT_INSTRUMENTATION_TEST_EVENTS_TO_SERVER", "true")
buildConfigField("String", "INSTRUMENTATION_TEST_ENVIRONMENT_KEY", "\"YOUR_ENVIRONMENT_KEY_HERE\"")
buildConfigField("String", "INSTRUMENTATION_TEST_ENVIRONMENT_KEY", "\"YOUR KEY HERE\"")
var theoLicense = System.getenv("THEOPLAYER_LICENSE") == null ? "NOT_CONFIGURED" : System.getenv("THEOPLAYER_LICENSE")
manifestPlaceholders.theoLicense = theoLicense
}
Expand Down Expand Up @@ -50,20 +50,6 @@ android {
flavorDimensions "api"

productFlavors {
minapi16 {
dimension "api"
}
minapi21 {
dimension "api"
minSdkVersion 21
}
minapi16ads {
dimension "api"
}
minapi21ads {
dimension "api"
minSdkVersion 21
}
v5 {
dimension 'api'
minSdkVersion 21
Expand Down Expand Up @@ -103,12 +89,6 @@ dependencies {
androidTestImplementation "androidx.test.ext:junit:1.1.5"

implementation project(":muxstatssdktheoplayer")

minapi16Implementation files("../common_libs/theoplayer-android-dist-56d3a9e5-4252-4bca-b650-180c8f16ce52-2.80.0-minapi16-release.aar")
minapi21Implementation files("../common_libs/theoplayer-android-dist-56d3a9e5-4252-4bca-b650-180c8f16ce52-2.80.0-minapi21-release.aar")
minapi16adsImplementation files("../common_libs/theoplayer-android-dist-56d3a9e5-4252-4bca-b650-180c8f16ce52-2.80.0-minapi16-release.aar")
minapi21adsImplementation files("../common_libs/theoplayer-android-dist-56d3a9e5-4252-4bca-b650-180c8f16ce52-2.80.0-minapi21-release.aar")

implementation "com.google.android.gms:play-services-auth:20.5.0"
implementation "com.google.android.gms:play-services-ads-identifier:18.0.1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,26 @@ public class RenditionChangeTests extends TestBase {

@Before
public void init(){
// urlToPlay = "http://localhost:5000/hls/google_glass/playlist.m3u8";
urlToPlay = "http://localhost:5000/dash/google_glass/playlist.mpd";
urlToPlay = "http://localhost:5000/hls/google_glass/playlist.m3u8";
// urlToPlay = "http://localhost:5000/dash/google_glass/playlist.mpd";
// urlToPlay = "https://cdn.theoplayer.com/video/dash/big_buck_bunny/BigBuckBunny_10s_simple_2014_05_09.mpd";

// These video have larger bitrate, make sure we do not cause any
// rebuffering due to low bandwith
bandwidthLimitInBitsPerSecond = 12000000;
// sourceType = SourceType.HLS;
sourceType = SourceType.DASH;
sourceType = SourceType.HLS;
// sourceType = SourceType.DASH;
super.init();
}

@Test
public void testRenditionChange() {
try {
if (playWhenReady) {
testActivity.runOnUiThread(() -> {
pView.getPlayer().play();
});
}
if(!testActivity.waitForPlaybackToStart(waitForPlaybackToStartInMS)) {
fail("Playback did not start in " + waitForPlaybackToStartInMS + " milliseconds !!!");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public abstract class TestBase {
// the regular amount of bytes to send.
// This will stop server completly, this will allow us to easier calculate the rebuffer period
protected int networkJamFactor = 5;
protected int waitForPlaybackToStartInMS = 30000;
protected int waitForPlaybackToStartInMS = 300000;
protected long playbackStartPosition = 0;
protected boolean playWhenReady = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public void startPlayback() {
player.setSource(testMediaSource);
player.setCurrentTime(playbackStartPosition);
}
// Version 5.9.1 do not work very well with dash and HLS, only MP4
player.setAutoplay(playWhenReady);
}

Expand Down
25 changes: 1 addition & 24 deletions muxstatssdktheoplayer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,6 @@ android {
flavorDimensions 'api'

productFlavors {
minapi16 {
dimension 'api'
}
minapi21 {
dimension 'api'
minSdkVersion 21
}
minapi16ads {
dimension 'api'
}
minapi21ads {
dimension 'api'
minSdkVersion 21
}
v5 {
dimension 'api'
minSdkVersion 21
Expand Down Expand Up @@ -81,17 +67,8 @@ muxDistribution {

dependencies {
implementation 'com.android.support:multidex:1.0.3'

// Legacy versions use `compileOnly` to avoid binary incompatibility issues.
//noinspection GradleDependency
minapi16adsCompileOnly 'com.theoplayer.theoplayer-sdk-android:basic-minapi16:2.92.0'
//noinspection GradleDependency
minapi16CompileOnly 'com.theoplayer.theoplayer-sdk-android:basic-minapi16:2.92.0'
minapi21CompileOnly 'com.theoplayer.theoplayer-sdk-android:basic-minapi21:2.92.0'
minapi21adsCompileOnly 'com.theoplayer.theoplayer-sdk-android:basic-minapi21:2.92.0'

//noinspection GradleDynamicVersion // THEO claims there will be no breaking changes.
v5Api 'com.theoplayer.theoplayer-sdk-android:core:+'
v5Api 'com.theoplayer.theoplayer-sdk-android:core:5.9.1'
//noinspection GradleDependency,GradleDynamicVersion // Old kotlin asked for by name in docs
v5Api 'org.jetbrains.kotlin:kotlin-stdlib:1.6.+'

Expand Down

0 comments on commit f4aa22f

Please sign in to comment.