This repository has been archived by the owner on Jul 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from SRGSSR/feature/akamai_qos_integration
Feature/akamai qos integration
- Loading branch information
Showing
32 changed files
with
502 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
include ':srgmediaplayer', ':srgmediaplayertestutils' | ||
include ':srgmediaplayer', ':srgmediaplayertestutils',':srgmediaplayerdemo' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
16 changes: 16 additions & 0 deletions
16
srgmediaplayer/src/main/java/ch/srg/mediaplayer/AkamaiMediaAnalyticsConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package ch.srg.mediaplayer; | ||
|
||
import android.util.Pair; | ||
|
||
/** | ||
* Copyright (c) SRG SSR. All rights reserved. | ||
* <p> | ||
* License information is available from the LICENSE file. | ||
*/ | ||
public interface AkamaiMediaAnalyticsConfiguration { | ||
String getAkamaiMediaAnalyticsConfigUrl(); | ||
|
||
String getAkamaiMediaAnalyticsViewerId(); | ||
|
||
Iterable<? extends Pair<String, String>> getAkamaiMediaAnalyticsDataSet(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 27 | ||
|
||
|
||
|
||
defaultConfig { | ||
applicationId "ch.srg.mediaplayer.demo" | ||
minSdkVersion 16 | ||
targetSdkVersion 27 | ||
versionCode 1 | ||
versionName "1.0" | ||
|
||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
|
||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
|
||
} | ||
|
||
dependencies { | ||
implementation fileTree(include: ['*.jar'], dir: 'libs') | ||
implementation 'com.android.support:appcompat-v7:27.1.1' | ||
implementation 'com.android.support.constraint:constraint-layout:1.1.0' | ||
testImplementation 'junit:junit:4.12' | ||
androidTestImplementation 'com.android.support.test:runner:1.0.2' | ||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' | ||
implementation project(':srgmediaplayer') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
26 changes: 26 additions & 0 deletions
26
srgmediaplayerdemo/src/androidTest/java/ch/srg/mediaplayer/demo/ExampleInstrumentedTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package ch.srg.mediaplayer.demo; | ||
|
||
import android.content.Context; | ||
import android.support.test.InstrumentationRegistry; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
*/ | ||
@RunWith(AndroidJUnit4.class) | ||
public class ExampleInstrumentedTest { | ||
@Test | ||
public void useAppContext() { | ||
// Context of the app under test. | ||
Context appContext = InstrumentationRegistry.getTargetContext(); | ||
|
||
assertEquals("ch.srg.mediaplayer.demo", appContext.getPackageName()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="ch.srg.mediaplayer.demo"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name=".MainActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
46 changes: 46 additions & 0 deletions
46
srgmediaplayerdemo/src/main/java/ch/srg/mediaplayer/demo/MainActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package ch.srg.mediaplayer.demo; | ||
|
||
import android.net.Uri; | ||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
|
||
import ch.srg.mediaplayer.SRGMediaPlayerController; | ||
import ch.srg.mediaplayer.SRGMediaPlayerException; | ||
import ch.srg.mediaplayer.SRGMediaPlayerView; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
|
||
private SRGMediaPlayerView mediaPlayerView; | ||
private SRGMediaPlayerController mediaPlayerController; | ||
private static final String URL = "https://srgplayerswivod-vh.akamaihd.net/i/44089658/,video,.mp4.csmil/master.m3u8?start=0.0&end=113.0"; | ||
private static final @SRGMediaPlayerController.SRGStreamType | ||
int streamType = SRGMediaPlayerController.STREAM_HLS; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
mediaPlayerView = findViewById(R.id.media_player_view); | ||
|
||
mediaPlayerController = new SRGMediaPlayerController(this, "demo_player"); | ||
} | ||
|
||
@Override | ||
protected void onResume() { | ||
super.onResume(); | ||
mediaPlayerController.bindToMediaPlayerView(mediaPlayerView); | ||
try { | ||
mediaPlayerController.play(Uri.parse(URL), streamType); | ||
} catch (SRGMediaPlayerException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
@Override | ||
protected void onPause() { | ||
super.onPause(); | ||
mediaPlayerController.unbindFromMediaPlayerView(mediaPlayerView); | ||
mediaPlayerController.release(); | ||
} | ||
|
||
} |
Oops, something went wrong.