Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre3567 committed Dec 10, 2024
1 parent c437b17 commit eb4e86f
Show file tree
Hide file tree
Showing 33 changed files with 172 additions and 245 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
3.4.1 - 2024/08/23
- Made compatible with android 14
- Updated dependancies
- Migrated from Exoplayer2 to Media3

3.3.9 - 2024/04/23
- Fix the error reconnection loop.
- Added the ability to change the speed of a podcast.
Expand Down
18 changes: 10 additions & 8 deletions ads/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ apply plugin: 'com.android.library'
apply from: '../export_aar.gradle'

android {
compileSdkVersion COMPILE_SDK_VERSION.toInteger()
buildToolsVersion BUILD_TOOLS_VERSION
compileSdk COMPILE_SDK_VERSION.toInteger()

defaultConfig {
minSdkVersion TRITONSDK_MIN_SDK_VERSION.toInteger()
Expand All @@ -17,12 +16,15 @@ android {
proguardFiles rootProject.file('proguard.txt')
}
}

packagingOptions {
exclude 'LICENSE.txt'
resources {
excludes += ['LICENSE.txt']
}
}

lintOptions {

namespace 'com.tritondigital.ads'
lint {
abortOnError false
}
}
Expand All @@ -31,9 +33,9 @@ dependencies {
api fileTree(include: ['*.jar'], dir: 'libs')
api project(':util')

androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test:rules:1.6.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
}


Expand Down
7 changes: 3 additions & 4 deletions ads/src/main/java/com/tritondigital/ads/AdLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public void setTag(String msg) {
TAG = msg;
}


/**
* Load an ad request.
*
Expand All @@ -90,7 +89,7 @@ public void load(String adRequest, Map<String,List<Integer>> dmpSegments) {
// Start VAST parsing
Log.i(TAG, "Loading ad request: " + adRequest);
if(dmpSegments == null){
mVastParsingTask = new VastParsingTask();
mVastParsingTask = new VastParsingTask();
}else{
mVastParsingTask = new VastParsingTask(dmpSegments);
}
Expand Down Expand Up @@ -198,9 +197,9 @@ private void onAdLoaded(Bundle ad) {

if(!isVastWrapper(ad)) {

if (mListener != null) {
if (mListener != null) {
ad.putStringArrayList(Ad.IMPRESSION_TRACKING_URLS, mImpressionUrls);
mListener.onAdLoaded(this, ad);
mListener.onAdLoaded(this, ad);
mNoRequest = 0;
mImpressionUrls = new ArrayList<>();
}
Expand Down
6 changes: 2 additions & 4 deletions ads/src/main/java/com/tritondigital/ads/AdParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ private void readLinear(XmlPullParser parser) throws XmlPullParserException, IOE
}
}
}



/**
* Reads the "Duration" tag.
*/
Expand All @@ -167,8 +166,7 @@ private void readDuration(XmlPullParser parser) throws XmlPullParserException, I
String duration = XmlPullParserUtil.readText(parser);
mAd.putString(Ad.DURATION, duration);
}



/**
* Read the "MediaFiles" tag.
*/
Expand Down
5 changes: 2 additions & 3 deletions ads/src/main/java/com/tritondigital/ads/AdRequestBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ public final class AdRequestBuilder {

/** @copybrief GENDER_VALUE_OTHER */
public static final char GENDER_VALUE_OTHER = 'o';

/**
* _int_ - Custom segment ID (1 to 1000000)
*
Expand Down Expand Up @@ -331,9 +332,7 @@ public final class AdRequestBuilder {
*/
public static final String BANNERS = "banners";



//TD Advertisement Guide version
//TD Advertisement Guide version
public static final String ADS_GUIDE_VERSION_KEY = "version";
public static final String ADS_GUIDE_VERSION_VALUE = "1.5.1";

Expand Down
11 changes: 5 additions & 6 deletions ads/src/main/java/com/tritondigital/ads/Interstitial.java
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ private void registerReceiver() {
mContext.registerReceiver(
mReceiver, playerFilter, Context.RECEIVER_NOT_EXPORTED);
} else {
mContext.registerReceiver(mReceiver, playerFilter);
}
mContext.registerReceiver(mReceiver, playerFilter);
}
}


Expand Down Expand Up @@ -334,13 +334,12 @@ private void releaseAdLoader() {
public void showAd(AdRequestBuilder adRequestBuilder, Map<String, List<Integer>> dmpSegments) {
if (mAdLoader != null) {
if(dmpSegments == null){
mAdLoader.load(adRequestBuilder);
mAdLoader.load(adRequestBuilder);
}else{
mAdLoader.load(adRequestBuilder,dmpSegments);
}
}

}

}
}

/**
Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ buildscript {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.7.1'
classpath 'com.google.gms:google-services:4.3.15'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
13 changes: 8 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,20 @@
# org.gradle.parallel=true

APP_VERSION_MAJOR = 3
APP_VERSION_MINOR = 3
APP_VERSION_PATCH = 9
APP_VERSION_MINOR = 4
APP_VERSION_PATCH = 1


APP_MIN_SDK_VERSION = 19
TRITONSDK_MIN_SDK_VERSION = 19

COMPILE_SDK_VERSION = 33
BUILD_TOOLS_VERSION = 30.0.3
TARGET_SDK_VERSION = 33
COMPILE_SDK_VERSION = 34
TARGET_SDK_VERSION = 34

org.gradle.jvmargs=-Xmx2000M
android.useAndroidX=true
android.enableJetifier=true
android.useFullClasspathForDexingTransform=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Jan 12 11:37:22 SAST 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip
36 changes: 18 additions & 18 deletions player/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ apply plugin: 'com.android.library'
apply from: '../export_aar.gradle'

android {
compileSdkVersion COMPILE_SDK_VERSION.toInteger()
buildToolsVersion BUILD_TOOLS_VERSION
compileSdk COMPILE_SDK_VERSION.toInteger()

defaultConfig {
minSdkVersion TRITONSDK_MIN_SDK_VERSION.toInteger()
Expand All @@ -16,22 +15,21 @@ android {
minifyEnabled true
proguardFiles rootProject.file('proguard.txt')
}

debug {
testCoverageEnabled = true
enableUnitTestCoverage true
enableAndroidTestCoverage true
}
}
lintOptions {
abortOnError false

}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

dexOptions {
jumboMode = true

namespace 'com.tritondigital.player'
lint {
abortOnError false
}
}

Expand All @@ -40,24 +38,26 @@ dependencies {
api project(':streamingproxy')
api project(':util')
implementation 'com.android.volley:volley:1.2.1'
implementation 'androidx.media3:media3-common:1.3.1'

// Unit testing dependencies.
testImplementation 'junit:junit:4.12' // Required -- JUnit 4 framework
testImplementation 'junit:junit:4.13.2' // Required -- JUnit 4 framework
testImplementation 'org.mockito:mockito-core:5.4.0' // Optional -- Mockito framework

//Android Test dependencies
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test:rules:1.6.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
androidTestImplementation 'org.hamcrest:hamcrest-library:2.2'
androidTestImplementation 'com.google.android.exoplayer:exoplayer-core:2.18.1'
androidTestImplementation 'com.google.android.exoplayer:exoplayer-hls:2.18.1'
androidTestImplementation 'androidx.media3:media3-exoplayer:1.4.1'
androidTestImplementation 'androidx.media3:media3-exoplayer-hls:1.4.1'

//Normal dependencies
api 'androidx.legacy:legacy-support-core-utils:1.0.0'
api 'androidx.mediarouter:mediarouter:1.2.1'

//Google ExoPlayer
implementation 'com.google.android.exoplayer:exoplayer-core:2.18.1'
implementation 'com.google.android.exoplayer:exoplayer-hls:2.18.1'
implementation 'androidx.media3:media3-exoplayer:1.4.0'
implementation 'androidx.media3:media3-exoplayer-hls:1.4.0'
}

33 changes: 2 additions & 31 deletions player/src/main/java/com/tritondigital/player/MediaPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import android.content.Context;
import android.os.Bundle;

import com.google.android.exoplayer2.Format;
import androidx.media3.common.Format;
import com.tritondigital.util.Assert;
import com.tritondigital.util.Log;

Expand Down Expand Up @@ -87,19 +87,6 @@ public interface OnStateChangedListener {
void onStateChanged(MediaPlayer player, int state);
}

/**
* Callback for receiving CuePoint.
*/
public interface OnAnalyticsReceivedListener {
/**
* Called when a player has received stream analytics.
*
* @param player Source where this event comes from
* @param format Received Format
*/
void onAnalyticsReceivedListener(MediaPlayer player, Format format);
}

/**
* Callback for receiving timeshift programs event.
*/
Expand Down Expand Up @@ -230,7 +217,6 @@ public interface OnCloudStreamInfoReceivedListener {
private OnMetaDataReceivedListener mMetadataListener;
private OnInfoListener mOnInfoListener;
private OnStateChangedListener mStateChangedListener;
private OnAnalyticsReceivedListener mAnalyticsReceivedListener;
private OnCloudStreamInfoReceivedListener mCloudStreamInfoReceivedListener;

private Bundle mLastCuePoint;
Expand Down Expand Up @@ -354,9 +340,6 @@ public OnStateChangedListener getOnStateChangedListener() {
return mStateChangedListener;
}

public OnAnalyticsReceivedListener getAnalyticsReceivedListener() {
return mAnalyticsReceivedListener;
}

public OnCloudStreamInfoReceivedListener getCloudStreamInfoReceivedListener() {
return mCloudStreamInfoReceivedListener;
Expand Down Expand Up @@ -392,12 +375,6 @@ public void setOnStateChangedListener(OnStateChangedListener listener) {
mStateChangedListener = listener;
}

/**
* Sets the analytics changed listener.
*/
public void setOnAnalyticsReceivedListener(OnAnalyticsReceivedListener listener) {
mAnalyticsReceivedListener = listener;
}

/**
* Sets the timeshift programs listener.
Expand Down Expand Up @@ -655,7 +632,6 @@ public final void release() {
mMetadataListener = null;
mOnInfoListener = null;
mStateChangedListener = null;
mAnalyticsReceivedListener = null;
}
}

Expand Down Expand Up @@ -684,12 +660,7 @@ final void setState(int state) {
}
}

final void notifyAnalytics(Format format) {
// Notify analytics changed.
if (mAnalyticsReceivedListener != null) {
mAnalyticsReceivedListener.onAnalyticsReceivedListener(this,format);
}
}


final void notifyCloudStreamInfo(String cloudStreamInfo) {
// Notify programs received.
Expand Down
2 changes: 2 additions & 0 deletions player/src/main/java/com/tritondigital/player/PlayerUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,6 @@ public static String normalizeTransport(String transport) {
static boolean isMountNameValid(String mount) {
return !TextUtils.isEmpty(mount);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,10 @@ private void readTransports(XmlPullParser parser, Bundle outProvisioningBundle)
outProvisioningBundle.putString(Result.TRANSPORT, "hls");
outProvisioningBundle.putString(Result.TIMESHIFT_MOUNT_SUFFIX, mountSuffix);
}else{
if ("hls".equals(transport)) {
outProvisioningBundle.putString(Result.TRANSPORT, transport);
outProvisioningBundle.putString(Result.MOUNT_SUFFIX, mountSuffix);
}
if ("hls".equals(transport)) {
outProvisioningBundle.putString(Result.TRANSPORT, transport);
outProvisioningBundle.putString(Result.MOUNT_SUFFIX, mountSuffix);
}
}
} else {
XmlPullParserUtil.skip(parser);
Expand Down
Loading

0 comments on commit eb4e86f

Please sign in to comment.