diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index d6c8da8..2fce3de 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -3,8 +3,24 @@ - [ ] Updated libraries to the latest version - [ ] Read through the README of the project +### Context description + +``` +INSERT PROJECT (Business Unit / project team) and a few words about your usage of the player +``` + ### Issue Description +``` +INSERT DESCRIPTION HERE +``` + +#### Steps to reproduce the behaviour + +``` +INSERT STEPS HERE +``` + ##### Complete stacktrace output ``` diff --git a/README.md b/README.md index ce71fb4..f4caa67 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,8 @@ -SRG Media Player +### SRG Media Player ### ================ -### Current version : 1.2.52 ### - -Building --------- -* install Android Studio from http://developer.android.com/sdk/installing/studio.html (stable build) -* checkout the project from github -* plug a device in ADB debug mode -* select Run/Run 'demo' -* select your device - -Device requirements -------------------- -* Android 4.0.3 or higher (API 15+) - -Setup for a custom project ---------------- - -Add maven repository in build.gradle: - - repositories { - maven { - url "http://maven.ecetest.rts.ch/content/groups/public/" - } - } - -Then use: - -```groovy -dependencies { -// ... - - compile 'ch.srg.mediaplayer:srgmediaplayer:$LIB_VERSION@aar' - compile 'ch.srg.mediaplayer:segmentOverlay:$LIB_VERSION@aar' - compile 'ch.srg.mediaplayer:srgmediaplayer-extras:$LIB_VERSION@aar' - compile 'ch.srg.mediaplayer:srgmediaplayer-service:$LIB_VERSION@aar' - - // Following three only for ChromeCast support (and srgmediaplayer-service use) - compile 'com.android.support:mediarouter-v7:$SUPPORT_VERSION' - compile 'com.google.android.gms:play-services-cast:$SUPPORT_VERSION' -// ... -} -``` - Features -------- -* has multiple selectable player engines: Android internal, ExoPlayer and more * audio and video * basic controls: play/pause/stop/seek * fluid rotation (stream continuity) @@ -56,74 +12,8 @@ Features * offer management of segments for a video. Display as smart overlays, control of streams through segments (segment-overlay module) * support for URL rewriting -Roadmap ----------------- -* Offer a full featured and customizable Activity or a lightweight Fragment to used in others app - -* Offer a full featured playlist management. Display, navigation, business logic. - -* Handle multiple formats: HLS, DASH, ... - -* UI can be easily customized with Theme or full custom layouts - Implementation ----------------- -* The fist step for integrate the SRG Media Player in your project is to configure your own dataProvider for bind your model to the API. In the demo application we have build a DummyDataProvider to handle data from web and specific videos. The class implements basic interface for dataProvider, and segments. - -```java - private static Map data = new HashMap() { - { - put("SPECIMEN", "http://stream-i.rts.ch/i/specm/2014/specm_20141203_full_f_817794-,101,701,1201,k.mp4.csmil/master.m3u8"); - put("ODK", "http://stream-i.rts.ch/i/oreki/2015/OREKI_20150225_full_f_861302-,101,701,1201,k.mp4.csmil/master.m3u8"); - put("BIDOUM", "http://stream-i.rts.ch/i/bidbi/2008/bidbi_01042008-,450,k.mp4.csmil/master.m3u8"); - put("MULTI1", "https://srgssruni9ch-lh.akamaihd.net/i/enc9uni_ch@191320/master.m3u8"); - put("MULTI2", "https://srgssruni10ch-lh.akamaihd.net/i/enc10uni_ch@191367/master.m3u8"); - put("MULTI3", "https://srgssruni7ch-lh.akamaihd.net/i/enc7uni_ch@191283/master.m3u8"); - put("MULTI4", "https://srgssruni11ch-lh.akamaihd.net/i/enc11uni_ch@191455/master.m3u8"); - put("ERROR", "http://invalid.stream/"); - }; - }; - - @Override - public Uri getUri(String mediaIdentifier) { - if (mediaIdentifier.contains("@")){ - mediaIdentifier = mediaIdentifier.substring(0,mediaIdentifier.indexOf('@')); - } - if (data.containsKey(mediaIdentifier)) { - return Uri.parse(data.get(mediaIdentifier)); - } - return null; - } -``` - -* In this basic implementation if we ask to the player to play the Media with the identifier SPECIMEN the dataProvider will send back the correct Uri to the player. - -* If you want to specify the media type you will play and set a delegate for it. You need to provide a PlayerDelegateFactory and set it to the player controller. - -```java - playerDelegateFactory = new PlayerDelegateFactory() { - @Override - public PlayerDelegate getDelegateForMediaIdentifier(PlayerDelegate.OnPlayerDelegateListener srgMediaPlayer, String mediaIdentifier) { - switch (multiDataProvider.getPrefix(mediaIdentifier)) { - case "aac": - return new ExoPlayerDelegate(DemoApplication.this,srgMediaPlayer, ExoPlayerDelegate.SourceType.EXTRACTOR); - case "native": - return new NativePlayerDelegate(srgMediaPlayer); - } - return new NativePlayerDelegate(srgMediaPlayer); - } - }; - srgMediaPlayerController.setPlayerDelegateFactory(playerDelegateFactory); -``` - -* In this example we configure a new PlayerDelegateFactory and specify the player delegate to use for each kind of prefix in our model. ExoPlayerDelegate for AAC and Native for other content. - -* A default PlayerDelegateFactory is already implemented, we use ExoPlayer for JellyBean and HLS content and NativePlayer for versions before JellyBean. - -* We have currently two delegates implemented, one for ExoPlayer and one for NativePlayer. You can create your custom delegate if you need to use a different kind of media player. Be sure to implement PlayerDelegate interface to handle communication between the player and the component. - -Next step is to add the SRGMediaPlayerView in your layout. - ```xml