├── .gitattributes ├── .gitignore ├── .gitmodules ├── LICENSE.txt ├── README.md ├── build.gradle ├── demo ├── .gitignore ├── build.gradle ├── demo_release.apk ├── demo_sr_1.gif ├── demo_sr_2.gif ├── demo_ui.gif └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ ├── sample.json │ ├── sample.mp4 │ ├── samples.audio.json │ └── samples.video.json │ ├── ic_launcher-web.png │ ├── java │ └── com │ │ └── jcodeing │ │ └── kmedia │ │ └── demo │ │ ├── AboutActivity.java │ │ ├── AudioQueueActivity.java │ │ ├── AudioQueueNotifier.java │ │ ├── MainActivity.java │ │ ├── MainLandCtrlLayer.java │ │ ├── MainPortCtrlLayer.java │ │ ├── MainVFloatingView.java │ │ ├── VideoMultipleActivity.java │ │ ├── VideoMultipleFloatingView.java │ │ ├── VideoQueueActivity.java │ │ ├── VideoQueueLandCtrlLayer.java │ │ ├── VideoSimpleActivity.java │ │ └── assist │ │ ├── Assist.java │ │ ├── AudioQueueAdapter.java │ │ ├── AudioQueuePlayerService.java │ │ ├── BitmapCache.java │ │ ├── MediaItem.java │ │ └── VideoQueueAdapter.java │ └── res │ ├── drawable-anydpi-v21 │ ├── k_ic_close.xml │ ├── k_ic_ffwd.xml │ ├── k_ic_media.xml │ ├── k_ic_next.xml │ ├── k_ic_pause.xml │ ├── k_ic_play.xml │ ├── k_ic_prev.xml │ ├── k_ic_rew.xml │ ├── k_ic_volume_down.xml │ ├── k_ic_volume_mute.xml │ └── k_ic_volume_up.xml │ ├── drawable-hdpi │ ├── k_ic_close.png │ ├── k_ic_ffwd.png │ ├── k_ic_media.png │ ├── k_ic_next.png │ ├── k_ic_pause.png │ ├── k_ic_play.png │ ├── k_ic_prev.png │ ├── k_ic_rew.png │ ├── k_ic_volume_down.png │ ├── k_ic_volume_mute.png │ └── k_ic_volume_up.png │ ├── drawable-ldpi │ ├── k_ic_close.png │ ├── k_ic_ffwd.png │ ├── k_ic_media.png │ ├── k_ic_next.png │ ├── k_ic_pause.png │ ├── k_ic_play.png │ ├── k_ic_prev.png │ ├── k_ic_rew.png │ ├── k_ic_volume_down.png │ ├── k_ic_volume_mute.png │ └── k_ic_volume_up.png │ ├── drawable-mdpi │ ├── k_ic_close.png │ ├── k_ic_ffwd.png │ ├── k_ic_media.png │ ├── k_ic_next.png │ ├── k_ic_pause.png │ ├── k_ic_play.png │ ├── k_ic_prev.png │ ├── k_ic_rew.png │ ├── k_ic_volume_down.png │ ├── k_ic_volume_mute.png │ └── k_ic_volume_up.png │ ├── drawable-xhdpi │ ├── k_ic_close.png │ ├── k_ic_ffwd.png │ ├── k_ic_media.png │ ├── k_ic_next.png │ ├── k_ic_pause.png │ ├── k_ic_play.png │ ├── k_ic_prev.png │ ├── k_ic_rew.png │ ├── k_ic_volume_down.png │ ├── k_ic_volume_mute.png │ └── k_ic_volume_up.png │ ├── drawable-xxhdpi │ ├── k_ic_close.png │ ├── k_ic_ffwd.png │ ├── k_ic_media.png │ ├── k_ic_next.png │ ├── k_ic_pause.png │ ├── k_ic_play.png │ ├── k_ic_prev.png │ ├── k_ic_rew.png │ ├── k_ic_volume_down.png │ ├── k_ic_volume_mute.png │ └── k_ic_volume_up.png │ ├── drawable │ ├── bg_button_selector.xml │ ├── bg_button_stroke_accent.xml │ ├── bg_button_stroke_primary.xml │ ├── bg_player_lock_left.xml │ ├── bg_radio_button_selector.xml │ ├── bg_video_queue_activity_oval.xml │ ├── bg_video_queue_activity_rectangle.xml │ ├── ic_brightness_down.xml │ ├── ic_brightness_up.xml │ ├── ic_ffwd_primary.xml │ ├── ic_go_back.xml │ ├── ic_go_full_screen.xml │ ├── ic_kmedia_logo.xml │ ├── ic_menu_kmedia.xml │ ├── ic_open_queue_menu.xml │ ├── ic_pause_primary.xml │ ├── ic_play_primary.xml │ ├── ic_player_locked.xml │ ├── ic_player_unlock.xml │ ├── ic_rectangle_primary.xml │ ├── ic_rew_primary.xml │ ├── selector_ab_enable.xml │ ├── selector_item_color_black.xml │ └── selector_item_color_white.xml │ ├── layout │ ├── activity_about.xml │ ├── activity_main.xml │ ├── activity_multiple_video.xml │ ├── activity_queue_audio.xml │ ├── activity_queue_video.xml │ ├── activity_simple.xml │ ├── ctrl_layer_custom_main.xml │ ├── ctrl_layer_land_main.xml │ ├── ctrl_layer_land_queue.xml │ ├── ctrl_layer_port_main.xml │ ├── floating_video_view_main.xml │ ├── floating_video_view_multiple.xml │ ├── item_audio_queue.xml │ ├── item_video_queue_land.xml │ ├── item_video_queue_port.xml │ └── nav_header_main.xml │ ├── menu │ ├── drawer.xml │ ├── main.xml │ ├── queue.xml │ └── simple.xml │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ ├── mipmap-xxxhdpi │ └── ic_launcher.png │ ├── values-v21 │ └── styles.xml │ └── values │ ├── colors.xml │ ├── strings.xml │ └── styles.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── init_modules.sh ├── readme └── icon │ ├── kmedia_core_fork.svg │ ├── kmedia_core_release.svg │ ├── kmedia_exo_fork.svg │ ├── kmedia_exo_release.svg │ ├── kmedia_logo.svg │ ├── kmedia_uie_fork.svg │ └── kmedia_uie_release.svg └── settings.gradle /.gitattributes: -------------------------------------------------------------------------------- 1 | 2 | *.sh linguist-language=java 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Gradle files 2 | .gradle 3 | /build 4 | # Local configuration file (sdk path, etc) 5 | /local.properties 6 | .idea/ 7 | # Project Automatically generate 8 | .DS_Store 9 | *.iml 10 | gradle.properties -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "core"] 2 | path = core 3 | url = git@github.com:jcodeing/KMedia-Core.git 4 | [submodule "uie"] 5 | path = uie 6 | url = git@github.com:jcodeing/KMedia-Uie.git 7 | [submodule "mpe"] 8 | path = mpe 9 | url = git@github.com:jcodeing/KMedia-Mpe.git 10 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 K Sun 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | buildscript { 15 | repositories { 16 | jcenter() 17 | } 18 | dependencies { 19 | classpath 'com.android.tools.build:gradle:2.3.2' 20 | } 21 | } 22 | 23 | allprojects { 24 | repositories { 25 | jcenter() 26 | } 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } -------------------------------------------------------------------------------- /demo/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | *.iml -------------------------------------------------------------------------------- /demo/build.gradle: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 K Sun 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | apply plugin: 'com.android.application' 15 | 16 | android { 17 | compileSdkVersion 25 18 | buildToolsVersion "25.0.3" 19 | 20 | defaultConfig { 21 | applicationId "com.jcodeing.kmedia.demo" 22 | minSdkVersion 16 23 | targetSdkVersion 25 24 | versionCode 1010 25 | versionName "1.0.10" 26 | 27 | vectorDrawables.useSupportLibrary = true 28 | } 29 | buildTypes { 30 | release { 31 | minifyEnabled false 32 | proguardFiles getDefaultProguardFile('proguard-android.txt') 33 | } 34 | } 35 | } 36 | 37 | dependencies { 38 | compile 'com.android.support:appcompat-v7:25.4.0' 39 | compile 'com.android.support:design:25.4.0' 40 | 41 | compile 'com.google.code.gson:gson:2.8.0' 42 | 43 | compile 'com.jcodeing:kmedia-core:r1.0.10' 44 | compile 'com.jcodeing:kmedia-uie:r1.0.10' 45 | compile 'com.jcodeing:kmedia-exo:r1.0.10' 46 | 47 | //compile project(':core') 48 | //compile project(':uie') 49 | //compile project(':exo') 50 | } 51 | 52 | repositories { 53 | maven { 54 | url 'https://maven.google.com/' 55 | name 'Google' 56 | } 57 | } -------------------------------------------------------------------------------- /demo/demo_release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/demo_release.apk -------------------------------------------------------------------------------- /demo/demo_sr_1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/demo_sr_1.gif -------------------------------------------------------------------------------- /demo/demo_sr_2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/demo_sr_2.gif -------------------------------------------------------------------------------- /demo/demo_ui.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/demo_ui.gif -------------------------------------------------------------------------------- /demo/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 34 | 35 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 51 | 55 | 60 | 64 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /demo/src/main/assets/sample.json: -------------------------------------------------------------------------------- 1 | { 2 | "mediaId": "s1", 3 | "mediaUri": "asset:///sample.mp4", 4 | "title": "Can you solve Einstein’s Riddle - Dan Van der Vieren", 5 | "description": "TED-Ed", 6 | "iconUri": "asset:///example.jpg", 7 | "posUnitList": [ 8 | { 9 | "cn": "在他颠覆物理学之前,", 10 | "en": "Before he turned physics upside down,", 11 | "start": 8600, 12 | "end": 11975 13 | }, 14 | { 15 | "cn": "一个年轻的阿尔伯特·爱因斯坦设计了一个带一系列线索的复杂的谜题来展示他的天分。", 16 | "en": "a young Albert Einstein supposedly showed off his genius by devising a complex riddle involving this list of clues.", 17 | "start": 12050, 18 | "end": 20675 19 | }, 20 | { 21 | "cn": "你能抗拒去解一个历史上最聪明的人之一写的谜团吗?让我们试一试。", 22 | "en": "Can you resist tackling a brain teaser written by one of the smartest people in history? Let's give it a shot.", 23 | "start": 21675, 24 | "end": 27925 25 | }, 26 | { 27 | "cn": "世界上最罕见的鱼从城市水族馆被盗了。", 28 | "en": "The world's rarest fish has been stolen from the city aquarium.", 29 | "start": 28325, 30 | "end": 32375 31 | }, 32 | { 33 | "cn": "警察追踪线索,查到有五座一模一样的房子的街上。", 34 | "en": "The police have followed the scent to a street with five identical looking houses.", 35 | "start": 32600, 36 | "end": 37600 37 | }, 38 | { 39 | "cn": "但是他们不能同时搜查所有的房子,他们一旦选错房子,便会打草惊蛇。", 40 | "en": "But they can't search all the houses at once, and if they pick the wrong one, the thief will know they're on his trail.", 41 | "start": 38550, 42 | "end": 44975 43 | }, 44 | { 45 | "cn": "就看你,城市里最棒的侦查员来破案。", 46 | "en": "It's up to you, the city's best detective, to solve the case.", 47 | "start": 45400, 48 | "end": 49400 49 | } 50 | ] 51 | } -------------------------------------------------------------------------------- /demo/src/main/assets/sample.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/assets/sample.mp4 -------------------------------------------------------------------------------- /demo/src/main/assets/samples.audio.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "mediaId": "a0", 4 | "title": "Jazz in Paris", 5 | "description": "Media Right Productions", 6 | "mediaUri": "http://storage.googleapis.com/automotive-media/Jazz_In_Paris.mp3", 7 | "iconUri": "http://storage.googleapis.com/automotive-media/album_art.jpg" 8 | }, 9 | { 10 | "mediaId": "a1", 11 | "title": "Hey Sailor", 12 | "description": "Letter Box", 13 | "mediaUri": "http://storage.googleapis.com/automotive-media/Hey_Sailor.mp3", 14 | "iconUri": "http://storage.googleapis.com/automotive-media/album_art_2.jpg" 15 | }, 16 | { 17 | "mediaId": "a2", 18 | "title": "The Coldest Shoulder", 19 | "description": "The 126ers", 20 | "mediaUri": "http://storage.googleapis.com/automotive-media/The_Coldest_Shoulder.mp3", 21 | "iconUri": "http://storage.googleapis.com/automotive-media/album_art_3.jpg" 22 | }, 23 | { 24 | "mediaId": "a3", 25 | "title": "Talkies", 26 | "description": "Huma-Huma", 27 | "mediaUri": "http://storage.googleapis.com/automotive-media/Talkies.mp3", 28 | "iconUri": "http://storage.googleapis.com/automotive-media/album_art.jpg" 29 | }, 30 | { 31 | "mediaId": "a4", 32 | "title": "Home", 33 | "description": "Letter Box", 34 | "mediaUri": "http://storage.googleapis.com/automotive-media/Home.mp3", 35 | "iconUri": "http://storage.googleapis.com/automotive-media/album_art_2.jpg" 36 | }, 37 | { 38 | "mediaId": "a5", 39 | "title": "Keys To The Kingdom", 40 | "description": "The 126ers", 41 | "mediaUri": "http://storage.googleapis.com/automotive-media/Keys_To_The_Kingdom.mp3", 42 | "iconUri": "http://storage.googleapis.com/automotive-media/album_art_3.jpg" 43 | }, 44 | { 45 | "mediaId": "a6", 46 | "title": "The Story Unfolds", 47 | "description": "Jingle Punks", 48 | "mediaUri": "http://storage.googleapis.com/automotive-media/The_Story_Unfolds.mp3", 49 | "iconUri": "http://storage.googleapis.com/automotive-media/album_art.jpg" 50 | }, 51 | { 52 | "mediaId": "a7", 53 | "title": "Motocross", 54 | "description": "Topher Mohr and Alex Elena", 55 | "mediaUri": "http://storage.googleapis.com/automotive-media/Motocross.mp3", 56 | "iconUri": "http://storage.googleapis.com/automotive-media/album_art_2.jpg" 57 | }, 58 | { 59 | "mediaId": "a8", 60 | "title": "On the Bach", 61 | "description": "Jingle Punks", 62 | "mediaUri": "http://storage.googleapis.com/automotive-media/On_the_Bach.mp3", 63 | "iconUri": "http://storage.googleapis.com/automotive-media/album_art.jpg" 64 | }, 65 | { 66 | "mediaId": "a9", 67 | "title": "Awakening", 68 | "description": "Silent Partner", 69 | "mediaUri": "http://storage.googleapis.com/automotive-media/Awakening.mp3", 70 | "iconUri": "http://storage.googleapis.com/automotive-media/album_art_2.jpg" 71 | }, 72 | { 73 | "mediaId": "a10", 74 | "title": "The Messenger", 75 | "description": "Silent Partner", 76 | "mediaUri": "http://storage.googleapis.com/automotive-media/The_Messenger.mp3", 77 | "iconUri": "http://storage.googleapis.com/automotive-media/album_art.jpg" 78 | }, 79 | { 80 | "mediaId": "a11", 81 | "title": "Tell The Angels", 82 | "description": "Letter Box", 83 | "mediaUri": "http://storage.googleapis.com/automotive-media/Tell_The_Angels.mp3", 84 | "iconUri": "http://storage.googleapis.com/automotive-media/album_art_2.jpg" 85 | } 86 | ] -------------------------------------------------------------------------------- /demo/src/main/assets/samples.video.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "mediaId": "v0", 4 | "mediaUri": "http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_h264.mov", 5 | "title": "Big Buck Bunny" 6 | }, 7 | { 8 | "mediaId": "v1", 9 | "mediaUri": "https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/bipbop_4x3_variant.m3u8", 10 | "title": "Apple 4x3 basic stream" 11 | }, 12 | { 13 | "mediaId": "v2", 14 | "mediaUri": "https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_16x9/bipbop_16x9_variant.m3u8", 15 | "title": "Apple 16x9 basic stream" 16 | }, 17 | { 18 | "mediaId": "v3", 19 | "mediaUri": "https://tungsten.aaplimg.com/VOD/bipbop_adv_example_v2/master.m3u8", 20 | "title": "Apple master playlist advanced (TS)" 21 | }, 22 | { 23 | "mediaId": "v4", 24 | "mediaUri": "https://tungsten.aaplimg.com/VOD/bipbop_adv_fmp4_example/master.m3u8", 25 | "title": "Apple master playlist advanced (fMP4)" 26 | }, 27 | { 28 | "mediaId": "v5", 29 | "mediaUri": "https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/gear1/prog_index.m3u8", 30 | "title": "Apple TS media playlist" 31 | }, 32 | { 33 | "mediaId": "v6", 34 | "mediaUri": "https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/gear0/prog_index.m3u8", 35 | "title": "Apple AAC media playlist" 36 | }, 37 | { 38 | "mediaId": "v7", 39 | "mediaUri": "http://devimages.apple.com/samplecode/adDemo/ad.m3u8", 40 | "title": "Apple ID3 metadata" 41 | } 42 | ] -------------------------------------------------------------------------------- /demo/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /demo/src/main/java/com/jcodeing/kmedia/demo/AboutActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 K Sun 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.jcodeing.kmedia.demo; 17 | 18 | import android.os.Bundle; 19 | import android.support.v7.app.AppCompatActivity; 20 | 21 | public class AboutActivity extends AppCompatActivity { 22 | 23 | @Override 24 | protected void onCreate(Bundle savedInstanceState) { 25 | super.onCreate(savedInstanceState); 26 | setContentView(R.layout.activity_about); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /demo/src/main/java/com/jcodeing/kmedia/demo/AudioQueueNotifier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 K Sun 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.jcodeing.kmedia.demo; 17 | 18 | import android.app.Notification; 19 | import android.app.PendingIntent; 20 | import android.content.Intent; 21 | import android.graphics.Bitmap; 22 | import android.support.v7.app.NotificationCompat.Builder; 23 | import com.jcodeing.kmedia.definition.IMediaItem; 24 | import com.jcodeing.kmedia.demo.assist.BitmapCache; 25 | import com.jcodeing.kmedia.worker.ANotifier; 26 | 27 | public class AudioQueueNotifier extends ANotifier { 28 | 29 | private Builder builder; 30 | 31 | @Override 32 | public void updateNotification(boolean mediaItemChanged) { 33 | //Update state(play/pause) 34 | addSimpleMediaAction(builder); 35 | if (mediaItemChanged) { 36 | //Update info(title/icon) 37 | setSimpleMediaInfo(builder, mediaItem); 38 | updateNotificationIcon(mediaItem.getIconUri().toString()); 39 | } 40 | notification = builder.build(); 41 | } 42 | 43 | @Override 44 | protected Notification createNotification(IMediaItem mediaItem) { 45 | builder = createSimpleMediaNotificationBuilder(mediaItem); 46 | //Update Icon 47 | updateNotificationIcon(mediaItem.getIconUri().toString()); 48 | //Content Intent 49 | Intent intent = new Intent(playerService, AudioQueueActivity.class) 50 | .setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); 51 | builder.setContentIntent(PendingIntent 52 | .getActivity(playerService, REQUEST_CODE, intent, PendingIntent.FLAG_CANCEL_CURRENT)); 53 | return builder.build(); 54 | } 55 | 56 | // ============================@Assist@============================ 57 | public void updateNotificationIcon(String iconStr) { 58 | BitmapCache cache = BitmapCache.getInstance(); 59 | if (cache.getBigImage(iconStr) != null) { 60 | builder.setLargeIcon(cache.getBigImage(iconStr)); 61 | helper.notify(NOTIFICATION_ID, notification = builder.build()); 62 | } else { 63 | cache.fetch(iconStr, new BitmapCache.FetchListener() { 64 | @Override 65 | public void onFetched(String url, Bitmap bitmap, Bitmap icon) { 66 | if (mediaItem != null && mediaItem.getIconUri().toString().equals(url)) { 67 | builder.setLargeIcon(bitmap); 68 | helper.notify(NOTIFICATION_ID, notification = builder.build()); 69 | } 70 | } 71 | }); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /demo/src/main/java/com/jcodeing/kmedia/demo/MainLandCtrlLayer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 K Sun 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.jcodeing.kmedia.demo; 17 | 18 | import android.content.Context; 19 | import android.content.res.TypedArray; 20 | import android.util.AttributeSet; 21 | import android.view.View; 22 | import android.view.View.OnClickListener; 23 | import android.widget.ImageView; 24 | import com.jcodeing.kmedia.IPlayer; 25 | import com.jcodeing.kmedia.assist.AnimationHelper; 26 | import com.jcodeing.kmedia.video.ControlLayerView; 27 | import com.jcodeing.kmedia.widget.DragTextView; 28 | 29 | public class MainLandCtrlLayer extends ControlLayerView implements OnClickListener { 30 | 31 | public MainLandCtrlLayer(Context context) { 32 | super(context); 33 | } 34 | 35 | public MainLandCtrlLayer(Context context, AttributeSet attrs) { 36 | super(context, attrs); 37 | } 38 | 39 | public MainLandCtrlLayer(Context context, AttributeSet attrs, int defStyleAttr) { 40 | super(context, attrs, defStyleAttr); 41 | } 42 | 43 | @Override 44 | protected boolean initAttrs(TypedArray a) { 45 | super.initAttrs(a); 46 | usePartTop = usePartLeft = usePartRight = true; 47 | return a != null;//top left right set default use 48 | } 49 | 50 | @Override 51 | protected int getDefaultLayoutId() { 52 | return R.layout.ctrl_layer_land_main; 53 | }//use custom layout 54 | 55 | private ImageView leftLock; 56 | private DragTextView subtitle; 57 | 58 | @Override 59 | protected void initView() { 60 | super.initView(); 61 | leftLock = (ImageView) findViewById(R.id.part_lock_left); 62 | leftLock.setOnClickListener(this); 63 | subtitle = (DragTextView) findViewById(R.id.part_subtitle); 64 | //override control group, public id click listener 65 | findViewById(R.id.k_rew).setOnClickListener(this); 66 | findViewById(R.id.k_ffwd).setOnClickListener(this); 67 | } 68 | 69 | @Override 70 | public void setVisibilityByInteractionArea(int visibility, boolean animation) { 71 | if (visibility == VISIBLE) { 72 | // =========@Show@========= 73 | //Lock 74 | if (leftLock.getVisibility() == View.GONE) { 75 | leftLock.setVisibility(VISIBLE); 76 | if (animation) { 77 | AnimationHelper.showLeft(leftLock, null); 78 | } 79 | } 80 | if (isLocked()) { 81 | return; 82 | } 83 | } else if (visibility == GONE || visibility == INVISIBLE) { 84 | // =========@Hide@========= 85 | //Lock 86 | if (leftLock.getVisibility() == View.VISIBLE) { 87 | if (animation) { 88 | AnimationHelper 89 | .hideLeft(leftLock, new AnimationHelper.AnimationActionListener() { 90 | public void onAnimationEnd() { 91 | leftLock.setVisibility(GONE); 92 | } 93 | }); 94 | } else { 95 | leftLock.setVisibility(GONE); 96 | } 97 | } 98 | if (isLocked()) { 99 | return; 100 | } 101 | } 102 | super.setVisibilityByInteractionArea(visibility, animation); 103 | } 104 | 105 | @Override 106 | public boolean isVisibleByInteractionArea() { 107 | if (isLocked()) { 108 | return leftLock.getVisibility() == VISIBLE; 109 | } 110 | return super.isVisibleByInteractionArea(); 111 | } 112 | 113 | @Override 114 | public void onClick(View v) { 115 | switch (v.getId()) { 116 | case R.id.k_ffwd: 117 | case R.id.k_rew: 118 | IPlayer player = getPlayer(); 119 | if (player != null) { 120 | player.seekToPositionUnitIndex( 121 | v.getId() == R.id.k_ffwd ? player.getCurrentPositionUnitIndex() + 1 122 | : player.getCurrentPositionUnitIndex() - 1); 123 | }//custom handle public id (k_ffwd,k_rew) 124 | break; 125 | case R.id.part_lock_left: 126 | if (getControlGroup() != null) { 127 | if (controlGroup.setLocked(!controlGroup.isLocked())) { 128 | leftLock.setImageResource(R.drawable.ic_player_locked); 129 | subtitle.setLocked(true); 130 | } else { 131 | leftLock.setImageResource(R.drawable.ic_player_unlock); 132 | subtitle.setLocked(false); 133 | } 134 | } 135 | break; 136 | } 137 | } 138 | 139 | public void setSubtitleText(CharSequence text) { 140 | if (subtitle.getVisibility() != VISIBLE) { 141 | subtitle.setVisibility(VISIBLE); 142 | } 143 | subtitle.setText(text); 144 | } 145 | 146 | public boolean isLocked() { 147 | return getControlGroup() != null && controlGroup.isLocked(); 148 | } 149 | 150 | public IPlayer getPlayer() { 151 | if (getControlGroup() != null) { 152 | return controlGroup.getPlayer(); 153 | } 154 | return null; 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /demo/src/main/java/com/jcodeing/kmedia/demo/MainPortCtrlLayer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 K Sun 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.jcodeing.kmedia.demo; 17 | 18 | import android.content.Context; 19 | import android.util.AttributeSet; 20 | import android.view.View; 21 | import android.view.View.OnClickListener; 22 | import com.jcodeing.kmedia.video.ControlLayerView; 23 | 24 | public class MainPortCtrlLayer extends ControlLayerView implements OnClickListener { 25 | 26 | public MainPortCtrlLayer(Context context) { 27 | super(context); 28 | } 29 | 30 | public MainPortCtrlLayer(Context context, AttributeSet attrs) { 31 | super(context, attrs); 32 | } 33 | 34 | public MainPortCtrlLayer(Context context, AttributeSet attrs, int defStyleAttr) { 35 | super(context, attrs, defStyleAttr); 36 | } 37 | 38 | @Override 39 | protected int getDefaultLayoutId() { 40 | return R.layout.ctrl_layer_port_main; 41 | } 42 | 43 | @Override 44 | protected void initView() { 45 | super.initView(); 46 | //Increase play/pause touch area 47 | //ProgressCircle add click listener handle play(?) 48 | findViewById(R.id.k_progress_any).setOnClickListener(this); 49 | } 50 | 51 | @Override 52 | public boolean isVisibleByPlayController() { 53 | //Play controller eternity visible. 54 | //Assist mainActivity replace control layer view progress. 55 | return true;//progress_main needs to be updated in real time. 56 | } 57 | 58 | @Override 59 | public void onClick(View v) { 60 | if (v.getId() == R.id.k_progress_any && getControlGroup() != null) { 61 | controlGroup.play(2);//Auto handle 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /demo/src/main/java/com/jcodeing/kmedia/demo/MainVFloatingView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 K Sun 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.jcodeing.kmedia.demo; 17 | 18 | import android.content.Context; 19 | import android.util.AttributeSet; 20 | import com.jcodeing.kmedia.window.VideoFloatingWindowView; 21 | 22 | public class MainVFloatingView extends VideoFloatingWindowView { 23 | 24 | public MainVFloatingView(Context context) { 25 | super(context); 26 | } 27 | 28 | public MainVFloatingView(Context context, AttributeSet attrs) { 29 | super(context, attrs); 30 | } 31 | 32 | public MainVFloatingView(Context context, AttributeSet attrs, int defStyleAttr) { 33 | super(context, attrs, defStyleAttr); 34 | } 35 | 36 | @Override 37 | protected int getDefaultLayoutId() { 38 | return R.layout.floating_video_view_main; 39 | } 40 | 41 | //Do something ... 42 | } 43 | -------------------------------------------------------------------------------- /demo/src/main/java/com/jcodeing/kmedia/demo/VideoMultipleActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 K Sun 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.jcodeing.kmedia.demo; 17 | 18 | import android.net.Uri; 19 | import android.os.Bundle; 20 | import android.support.v7.app.AppCompatActivity; 21 | import android.view.Gravity; 22 | import android.view.View; 23 | import android.view.View.OnClickListener; 24 | import com.jcodeing.kmedia.IPlayer; 25 | import com.jcodeing.kmedia.Player; 26 | import com.jcodeing.kmedia.exo.ExoMediaPlayer; 27 | import com.jcodeing.kmedia.window.FloatingWindowController; 28 | import com.jcodeing.kmedia.window.FloatingWindowController.Listener; 29 | import com.jcodeing.kmedia.window.VideoFloatingWindowController; 30 | 31 | public class VideoMultipleActivity extends AppCompatActivity implements OnClickListener { 32 | 33 | @Override 34 | protected void onCreate(Bundle savedInstanceState) { 35 | super.onCreate(savedInstanceState); 36 | setContentView(R.layout.activity_multiple_video); 37 | findViewById(R.id.video_1).setOnClickListener(this); 38 | findViewById(R.id.video_2).setOnClickListener(this); 39 | findViewById(R.id.video_3).setOnClickListener(this); 40 | findViewById(R.id.video_4).setOnClickListener(this); 41 | findViewById(R.id.video_5).setOnClickListener(this); 42 | findViewById(R.id.video_6).setOnClickListener(this); 43 | } 44 | 45 | @Override 46 | public void onClick(View v) { 47 | launchFloatingVideo(v); 48 | } 49 | 50 | private int[] locationOnScreen = new int[2]; 51 | 52 | private void launchFloatingVideo(View v) { 53 | if (v != null) { 54 | // =========@FloatingWindowController@========= 55 | VideoFloatingWindowController controller = 56 | new VideoFloatingWindowController(getApplicationContext()); 57 | controller.setListener(new Listener() { 58 | @Override 59 | public void onHide(FloatingWindowController controller) { 60 | VideoFloatingWindowController c = (VideoFloatingWindowController) controller; 61 | c.getPlayer().shutdown();//on hide, shutdown player. release resource. 62 | } 63 | }); 64 | // =========@Location XY 65 | v.getLocationOnScreen(locationOnScreen); 66 | controller.setGravity(Gravity.TOP | Gravity.START) 67 | .setFloatingWindowXY(locationOnScreen[0], locationOnScreen[1]); 68 | // =========@Size 69 | int width = v.getWidth(); 70 | int height = width * 3 / 4; 71 | if (height > v.getHeight()) { 72 | height = v.getHeight(); 73 | } 74 | controller.setFloatingWindowSize(width, height); 75 | controller.setFloatingView( 76 | new VideoMultipleFloatingView(this, width / 2, height / 2)); 77 | // =========@Player@========= 78 | IPlayer player = new Player(getApplicationContext()) 79 | .init(new ExoMediaPlayer(getApplicationContext())); 80 | //multiple videos disable audio focus manage 81 | player.setEnabledAudioFocusManage(false); 82 | // =========@Play 83 | controller.show(player); 84 | player.play(Uri.parse("asset:///" + "sample.mp4")); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /demo/src/main/java/com/jcodeing/kmedia/demo/VideoMultipleFloatingView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 K Sun 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.jcodeing.kmedia.demo; 17 | 18 | import android.content.Context; 19 | import android.util.AttributeSet; 20 | import com.jcodeing.kmedia.window.FloatingWindow; 21 | import com.jcodeing.kmedia.window.VideoFloatingWindowView; 22 | 23 | public class VideoMultipleFloatingView extends VideoFloatingWindowView { 24 | 25 | private int minWidth = 111; 26 | private int minHeight = 111; 27 | 28 | public VideoMultipleFloatingView(Context context, int minWidth, int minHeight) { 29 | super(context); 30 | this.minWidth = minWidth; 31 | this.minHeight = minHeight; 32 | } 33 | 34 | public VideoMultipleFloatingView(Context context) { 35 | super(context); 36 | } 37 | 38 | public VideoMultipleFloatingView(Context context, AttributeSet attrs) { 39 | super(context, attrs); 40 | } 41 | 42 | public VideoMultipleFloatingView(Context context, AttributeSet attrs, int defStyleAttr) { 43 | super(context, attrs, defStyleAttr); 44 | } 45 | 46 | @Override 47 | protected int getDefaultLayoutId() { 48 | return R.layout.floating_video_view_multiple; 49 | } 50 | 51 | @Override 52 | protected void onSet(FloatingWindow floatingWindow) { 53 | this.floatingWindow = floatingWindow; 54 | floatingWindow 55 | .setMinWidthHeight(minWidth, minHeight); 56 | floatingWindow 57 | .setMaxWidthHeight(displayWidth, displayHeight); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /demo/src/main/java/com/jcodeing/kmedia/demo/VideoQueueLandCtrlLayer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 K Sun 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.jcodeing.kmedia.demo; 17 | 18 | import android.content.Context; 19 | import android.content.res.TypedArray; 20 | import android.support.v7.widget.DefaultItemAnimator; 21 | import android.support.v7.widget.DividerItemDecoration; 22 | import android.support.v7.widget.LinearLayoutManager; 23 | import android.support.v7.widget.RecyclerView; 24 | import android.util.AttributeSet; 25 | import android.view.View; 26 | import android.view.View.OnClickListener; 27 | import android.widget.LinearLayout; 28 | import com.jcodeing.kmedia.assist.AnimationHelper; 29 | import com.jcodeing.kmedia.definition.IMediaQueue; 30 | import com.jcodeing.kmedia.demo.assist.VideoQueueAdapter; 31 | import com.jcodeing.kmedia.video.ControlLayerView; 32 | 33 | public class VideoQueueLandCtrlLayer extends ControlLayerView implements OnClickListener { 34 | 35 | public VideoQueueLandCtrlLayer(Context context) { 36 | super(context); 37 | } 38 | 39 | public VideoQueueLandCtrlLayer(Context context, AttributeSet attrs) { 40 | super(context, attrs); 41 | } 42 | 43 | public VideoQueueLandCtrlLayer(Context context, AttributeSet attrs, int defStyleAttr) { 44 | super(context, attrs, defStyleAttr); 45 | } 46 | 47 | @Override 48 | protected boolean initAttrs(TypedArray a) { 49 | super.initAttrs(a); 50 | usePartTop = usePartLeft = usePartRight = true; 51 | return a != null;//top left right set default use 52 | } 53 | 54 | @Override 55 | protected int getDefaultLayoutId() { 56 | return R.layout.ctrl_layer_land_queue; 57 | }//use custom layout 58 | 59 | 60 | private RecyclerView recyclerView; 61 | private View videoQueueMenu; 62 | 63 | @Override 64 | protected void initView() { 65 | super.initView(); 66 | findViewById(R.id.v_queue_menu_open).setOnClickListener(this); 67 | findViewById(R.id.v_queue_menu_close).setOnClickListener(this); 68 | videoQueueMenu = findViewById(R.id.v_queue_menu); 69 | recyclerView = (RecyclerView) findViewById(R.id.part_v_recycler); 70 | recyclerView.setLayoutManager(new LinearLayoutManager(getContext())); 71 | recyclerView.setAdapter(new VideoQueueAdapter(getContext(), true)); 72 | recyclerView.setItemAnimator(new DefaultItemAnimator()); 73 | recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), LinearLayout.VERTICAL)); 74 | } 75 | 76 | @Override 77 | public void setVisibilityByInteractionArea(int visibility, boolean animation) { 78 | if (visibility == VISIBLE) { 79 | setVisibilityByListArea(GONE, true, false); 80 | } 81 | super.setVisibilityByInteractionArea(visibility, animation); 82 | } 83 | 84 | // ============================@Queue@============================ 85 | public void setMediaQueue(IMediaQueue mediaQueue) { 86 | ((VideoQueueAdapter) recyclerView.getAdapter()) 87 | .setMediaQueue(mediaQueue); 88 | } 89 | 90 | public void setVisibilityByListArea(int visibility, boolean animation, boolean isHandleIntera) { 91 | if (visibility == VISIBLE) { 92 | // =========@Show@========= 93 | if (videoQueueMenu.getVisibility() == View.GONE) { 94 | //gone interaction area 95 | if (isHandleIntera) { 96 | setVisibilityByInteractionArea(GONE, true); 97 | } 98 | //show video list 99 | videoQueueMenu.setVisibility(VISIBLE); 100 | if (animation) { 101 | AnimationHelper.showRight(videoQueueMenu, null); 102 | } 103 | } 104 | } else if (visibility == GONE || visibility == INVISIBLE) { 105 | // =========@Hide@========= 106 | if (videoQueueMenu.getVisibility() == View.VISIBLE) { 107 | //gone video list 108 | if (animation) { 109 | AnimationHelper 110 | .hideRight(videoQueueMenu, new AnimationHelper.AnimationActionListener() { 111 | public void onAnimationEnd() { 112 | videoQueueMenu.setVisibility(GONE); 113 | } 114 | }); 115 | } else { 116 | videoQueueMenu.setVisibility(GONE); 117 | } 118 | //show interaction area 119 | if (isHandleIntera && getControlGroup() != null) { 120 | controlGroup.show(); 121 | } 122 | } 123 | } 124 | } 125 | 126 | @Override 127 | public void onClick(View v) { 128 | if (v.getId() == R.id.v_queue_menu_open) { 129 | setVisibilityByListArea(VISIBLE, true, true); 130 | recyclerView.scrollToPosition(//Scroll to current play video index 131 | ((VideoQueueAdapter) recyclerView.getAdapter()).getMediaQueue().getCurrentIndex()); 132 | } else if (v.getId() == R.id.v_queue_menu_close) { 133 | setVisibilityByListArea(GONE, true, true); 134 | } 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /demo/src/main/java/com/jcodeing/kmedia/demo/VideoSimpleActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 K Sun 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.jcodeing.kmedia.demo; 17 | 18 | import android.net.Uri; 19 | import android.os.Bundle; 20 | import android.support.v7.app.AppCompatActivity; 21 | import android.view.Menu; 22 | import android.view.MenuItem; 23 | import android.view.SurfaceView; 24 | import com.jcodeing.kmedia.AndroidMediaPlayer; 25 | import com.jcodeing.kmedia.IPlayer; 26 | import com.jcodeing.kmedia.Player; 27 | import com.jcodeing.kmedia.exo.ExoMediaPlayer; 28 | import com.jcodeing.kmedia.video.PlayerView; 29 | 30 | public class VideoSimpleActivity extends AppCompatActivity { 31 | 32 | private IPlayer player; 33 | private PlayerView playerView; 34 | 35 | @Override 36 | protected void onCreate(Bundle savedInstanceState) { 37 | super.onCreate(savedInstanceState); 38 | setContentView(R.layout.activity_simple); 39 | 40 | player = new Player(this).init(new ExoMediaPlayer(this)); 41 | 42 | playerView = ((PlayerView) findViewById(R.id.k_player_view)).setPlayer(player); 43 | 44 | player.play(Uri.parse("asset:///" + "sample.mp4")); 45 | } 46 | 47 | @Override 48 | protected void onResume() { 49 | super.onResume(); 50 | playerView.onResume(); 51 | } 52 | 53 | @Override 54 | protected void onPause() { 55 | super.onPause(); 56 | playerView.onPause(); 57 | } 58 | 59 | @Override 60 | public void finish() { 61 | super.finish(); 62 | playerView.finish(); 63 | player.shutdown(); 64 | } 65 | 66 | // ============================@Menu 67 | @Override 68 | public boolean onCreateOptionsMenu(Menu menu) { 69 | getMenuInflater().inflate(R.menu.simple, menu); 70 | return true; 71 | } 72 | 73 | @Override 74 | public boolean onOptionsItemSelected(MenuItem item) { 75 | item.setChecked(true); 76 | if (item.getItemId() == R.id.android) { 77 | // =========@AndroidMediaPlayer@========= 78 | player.init(new AndroidMediaPlayer()); 79 | playerView.setPlayer(null); 80 | playerView.setSurfaceView(new SurfaceView(this)); 81 | playerView.setPlayer(player); 82 | player.play(Uri.parse( 83 | "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4")); 84 | } else { 85 | // =========@ExoMediaPlayer@========= 86 | player.init(new ExoMediaPlayer(this)); 87 | playerView.setPlayer(null); 88 | playerView.setSurfaceView(new SurfaceView(this)); 89 | playerView.setPlayer(player); 90 | player.play(Uri.parse("asset:///" + "sample.mp4")); 91 | } 92 | return true; 93 | } 94 | } -------------------------------------------------------------------------------- /demo/src/main/java/com/jcodeing/kmedia/demo/assist/Assist.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 K Sun 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.jcodeing.kmedia.demo.assist; 17 | 18 | import com.google.gson.Gson; 19 | import java.io.BufferedReader; 20 | import java.io.FileInputStream; 21 | import java.io.IOException; 22 | import java.io.InputStream; 23 | import java.io.InputStreamReader; 24 | 25 | public class Assist { 26 | 27 | public static final Gson gson; 28 | 29 | static { 30 | gson = new Gson(); 31 | } 32 | 33 | public static String getStringFromFilePath(String filePath) throws IOException { 34 | return getStringFromInputStream(new FileInputStream(filePath)); 35 | } 36 | 37 | public static String getStringFromInputStream(InputStream inputStream) throws IOException { 38 | BufferedReader r = new BufferedReader(new InputStreamReader(inputStream)); 39 | StringBuilder sb = new StringBuilder(); 40 | String line; 41 | while ((line = r.readLine()) != null) { 42 | sb.append(line); 43 | } 44 | return sb.toString(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /demo/src/main/java/com/jcodeing/kmedia/demo/assist/AudioQueueAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 K Sun 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.jcodeing.kmedia.demo.assist; 17 | 18 | import android.content.Context; 19 | import android.support.v7.widget.RecyclerView; 20 | import android.view.LayoutInflater; 21 | import android.view.View; 22 | import android.view.View.OnClickListener; 23 | import android.view.ViewGroup; 24 | import android.widget.TextView; 25 | import com.jcodeing.kmedia.adapter.MediaQueueRecyclerAdapter; 26 | import com.jcodeing.kmedia.definition.IMediaItem; 27 | import com.jcodeing.kmedia.demo.R; 28 | import com.jcodeing.kmedia.demo.assist.AudioQueueAdapter.LocalViewHolder; 29 | 30 | public class AudioQueueAdapter extends MediaQueueRecyclerAdapter { 31 | 32 | private final LayoutInflater inflater; 33 | 34 | public AudioQueueAdapter(Context context) { 35 | inflater = LayoutInflater.from(context); 36 | } 37 | 38 | @Override 39 | public LocalViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 40 | return new LocalViewHolder( 41 | inflater.inflate(R.layout.item_audio_queue, parent, false)); 42 | } 43 | 44 | @Override 45 | public void onBindViewHolder(LocalViewHolder holder, int position) { 46 | holder.bindViewData(mediaQueue.getMediaItem(position), position); 47 | } 48 | 49 | class LocalViewHolder extends RecyclerView.ViewHolder implements OnClickListener { 50 | 51 | LocalViewHolder(View view) { 52 | super(view); 53 | view.setOnClickListener(this); 54 | } 55 | 56 | void bindViewData(IMediaItem mediaItem, int position) { 57 | ((TextView) itemView).setText(mediaItem.getTitle()); 58 | itemView.setSelected(position == mediaQueue.getCurrentIndex()); 59 | } 60 | 61 | @Override 62 | public void onClick(View v) { 63 | mediaQueue.skipToIndex(getLayoutPosition()); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /demo/src/main/java/com/jcodeing/kmedia/demo/assist/AudioQueuePlayerService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 K Sun 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.jcodeing.kmedia.demo.assist; 17 | 18 | import android.view.KeyEvent; 19 | import com.jcodeing.kmedia.IPlayer; 20 | import com.jcodeing.kmedia.assist.KeyXClickHelper; 21 | import com.jcodeing.kmedia.assist.KeyXClickHelper.OnXClickCallback; 22 | import com.jcodeing.kmedia.assist.MediaButtonReceiverHelper; 23 | import com.jcodeing.kmedia.assist.MediaButtonReceiverHelper.OnMediaButtonEventListener; 24 | import com.jcodeing.kmedia.assist.MediaButtonReceiverHelper.PlayerAskFor; 25 | import com.jcodeing.kmedia.service.PlayerService; 26 | 27 | public class AudioQueuePlayerService extends PlayerService { 28 | 29 | @Override 30 | public void onCreate() { 31 | super.onCreate(); 32 | // =========@MediaButtonReceiver@========= 33 | MediaButtonReceiverHelper.i()//To sole 34 | .setDefaultMediaButtonReceiverToSole(this, true); 35 | // =========@Handle Media Event(Default+Custom) 36 | // =====@Default 37 | // Assist media button event default handle setPlayerAskFor(.) 38 | MediaButtonReceiverHelper.i().setPlayerAskFor(new PlayerAskFor() { 39 | @Override 40 | public IPlayer player() { 41 | return mPlayer;//Internal use player handle media button event 42 | }//If you don't use the default handle, don't need to setPlayerAskFor(.) 43 | }); 44 | // =====@Custom 45 | KeyXClickHelper.i().setOnXClickCallback(new OnXClickCallback() { 46 | @Override 47 | public void onXClick(int state, int count, KeyEvent keyEvent) { 48 | //Custom handle media button event [by click count] 49 | if (count == 1) {//click count : 1 50 | if (mPlayer.isPlaying()) { 51 | mPlayer.pause(); 52 | } else if (mPlayer.isPlayable()) { 53 | mPlayer.start(); 54 | } 55 | } else {//other click count 56 | //Do something ... 57 | mPlayer.getMediaQueue().skipToNext(); 58 | } 59 | } 60 | }); 61 | // Intercept [KEYCODE_HEADSETHOOK,KEYCODE_MEDIA_PLAY_PAUSE] -dispatch-> xClick 62 | MediaButtonReceiverHelper.i().setOnMediaButtonEventListener(new OnMediaButtonEventListener() { 63 | @Override 64 | public boolean onMediaButtonEvent(KeyEvent keyEvent) { 65 | int keyCode = keyEvent.getKeyCode(); 66 | if (keyCode == KeyEvent.KEYCODE_HEADSETHOOK || 67 | keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE) { 68 | KeyXClickHelper.i().xClick(keyEvent); 69 | return true;//Custom handle media button event 70 | } 71 | return false;//Other media button event don't handle(super-> default handle) 72 | } 73 | }); 74 | } 75 | 76 | @Override 77 | public void onDestroy() { 78 | super.onDestroy(); 79 | MediaButtonReceiverHelper.i() 80 | .setDefaultMediaButtonReceiverToSole(this, false); 81 | } 82 | } -------------------------------------------------------------------------------- /demo/src/main/java/com/jcodeing/kmedia/demo/assist/BitmapCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.jcodeing.kmedia.demo.assist; 18 | 19 | import android.graphics.Bitmap; 20 | import android.graphics.BitmapFactory; 21 | import android.os.AsyncTask; 22 | import android.util.LruCache; 23 | import java.io.BufferedInputStream; 24 | import java.io.IOException; 25 | import java.io.InputStream; 26 | import java.net.HttpURLConnection; 27 | import java.net.URL; 28 | 29 | /** 30 | * Implements a basic cache of album arts, with async loading support. 31 | */ 32 | public final class BitmapCache { 33 | 34 | private static final int MAX_ALBUM_ART_CACHE_SIZE = 12 * 1024 * 1024; // 12 MB 35 | private static final int MAX_ART_WIDTH = 800; // pixels 36 | private static final int MAX_ART_HEIGHT = 480; // pixels 37 | 38 | // Resolution reasonable for carrying around as an icon (generally in 39 | // MediaDescription.getIconBitmap). This should not be bigger than necessary, because 40 | // the MediaDescription object should be lightweight. If you set it too high and try to 41 | // serialize the MediaDescription, you may get FAILED BINDER TRANSACTION errors. 42 | private static final int MAX_ART_WIDTH_ICON = 128; // pixels 43 | private static final int MAX_ART_HEIGHT_ICON = 128; // pixels 44 | 45 | private static final int BIG_BITMAP_INDEX = 0; 46 | private static final int ICON_BITMAP_INDEX = 1; 47 | 48 | private final LruCache mCache; 49 | 50 | private static final BitmapCache sInstance = new BitmapCache(); 51 | 52 | public static BitmapCache getInstance() { 53 | return sInstance; 54 | } 55 | 56 | public BitmapCache() { 57 | // Holds no more than MAX_ALBUM_ART_CACHE_SIZE bytes, bounded by maxmemory/4 and 58 | // Integer.MAX_VALUE: 59 | int maxSize = Math.min(MAX_ALBUM_ART_CACHE_SIZE, 60 | (int) (Math.min(Integer.MAX_VALUE, Runtime.getRuntime().maxMemory() / 4))); 61 | mCache = new LruCache(maxSize) { 62 | @Override 63 | protected int sizeOf(String key, Bitmap[] value) { 64 | return value[BIG_BITMAP_INDEX].getByteCount() 65 | + value[ICON_BITMAP_INDEX].getByteCount(); 66 | } 67 | }; 68 | } 69 | 70 | public Bitmap getBigImage(String artUrl) { 71 | Bitmap[] result = mCache.get(artUrl); 72 | return result == null ? null : result[BIG_BITMAP_INDEX]; 73 | } 74 | 75 | public Bitmap getIconImage(String artUrl) { 76 | Bitmap[] result = mCache.get(artUrl); 77 | return result == null ? null : result[ICON_BITMAP_INDEX]; 78 | } 79 | 80 | public void fetch(final String artUrl, final FetchListener listener) { 81 | // WARNING: for the sake of simplicity, simultaneous multi-thread fetch requests 82 | // are not handled properly: they may cause redundant costly operations, like HTTP 83 | // requests and bitmap rescales. For production-level apps, we recommend you use 84 | // a proper image loading library, like Glide. 85 | Bitmap[] bitmap = mCache.get(artUrl); 86 | if (bitmap != null) { 87 | listener.onFetched(artUrl, bitmap[BIG_BITMAP_INDEX], bitmap[ICON_BITMAP_INDEX]); 88 | return; 89 | } 90 | 91 | new AsyncTask() { 92 | @Override 93 | protected Bitmap[] doInBackground(Void[] objects) { 94 | Bitmap[] bitmaps; 95 | try { 96 | Bitmap bitmap = fetchAndRescaleBitmap(artUrl, 97 | MAX_ART_WIDTH, MAX_ART_HEIGHT); 98 | Bitmap icon = scaleBitmap(bitmap, 99 | MAX_ART_WIDTH_ICON, MAX_ART_HEIGHT_ICON); 100 | bitmaps = new Bitmap[]{bitmap, icon}; 101 | mCache.put(artUrl, bitmaps); 102 | } catch (IOException e) { 103 | return null; 104 | } 105 | return bitmaps; 106 | } 107 | 108 | @Override 109 | protected void onPostExecute(Bitmap[] bitmaps) { 110 | if (bitmaps == null) { 111 | listener.onError(artUrl, new IllegalArgumentException("got null bitmaps")); 112 | } else { 113 | listener.onFetched(artUrl, 114 | bitmaps[BIG_BITMAP_INDEX], bitmaps[ICON_BITMAP_INDEX]); 115 | } 116 | } 117 | }.execute(); 118 | } 119 | 120 | public static abstract class FetchListener { 121 | 122 | public abstract void onFetched(String url, Bitmap bigImage, Bitmap iconImage); 123 | 124 | public void onError(String url, Exception e) { 125 | //Do nothing 126 | } 127 | } 128 | 129 | // ============================@BitmapHelper@============================ 130 | // Max read limit that we allow our input stream to mark/reset. 131 | private static final int MAX_READ_LIMIT_PER_IMG = 1024 * 1024; 132 | 133 | public static Bitmap scaleBitmap(Bitmap src, int maxWidth, int maxHeight) { 134 | double scaleFactor = Math.min( 135 | ((double) maxWidth) / src.getWidth(), ((double) maxHeight) / src.getHeight()); 136 | return Bitmap.createScaledBitmap(src, 137 | (int) (src.getWidth() * scaleFactor), (int) (src.getHeight() * scaleFactor), false); 138 | } 139 | 140 | public static Bitmap scaleBitmap(int scaleFactor, InputStream is) { 141 | // Get the dimensions of the bitmap 142 | BitmapFactory.Options bmOptions = new BitmapFactory.Options(); 143 | 144 | // Decode the image file into a Bitmap sized to fill the View 145 | bmOptions.inJustDecodeBounds = false; 146 | bmOptions.inSampleSize = scaleFactor; 147 | 148 | return BitmapFactory.decodeStream(is, null, bmOptions); 149 | } 150 | 151 | public static int findScaleFactor(int targetW, int targetH, InputStream is) { 152 | // Get the dimensions of the bitmap 153 | BitmapFactory.Options bmOptions = new BitmapFactory.Options(); 154 | bmOptions.inJustDecodeBounds = true; 155 | BitmapFactory.decodeStream(is, null, bmOptions); 156 | int actualW = bmOptions.outWidth; 157 | int actualH = bmOptions.outHeight; 158 | 159 | // Determine how much to scale down the image 160 | return Math.min(actualW / targetW, actualH / targetH); 161 | } 162 | 163 | @SuppressWarnings("SameParameterValue") 164 | public static Bitmap fetchAndRescaleBitmap(String uri, int width, int height) 165 | throws IOException { 166 | URL url = new URL(uri); 167 | BufferedInputStream is = null; 168 | try { 169 | HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); 170 | is = new BufferedInputStream(urlConnection.getInputStream()); 171 | is.mark(MAX_READ_LIMIT_PER_IMG); 172 | int scaleFactor = findScaleFactor(width, height, is); 173 | is.reset(); 174 | return scaleBitmap(scaleFactor, is); 175 | } finally { 176 | if (is != null) { 177 | is.close(); 178 | } 179 | } 180 | } 181 | 182 | } 183 | -------------------------------------------------------------------------------- /demo/src/main/java/com/jcodeing/kmedia/demo/assist/MediaItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 K Sun 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.jcodeing.kmedia.demo.assist; 17 | 18 | import android.net.Uri; 19 | import android.os.Bundle; 20 | import android.os.Parcel; 21 | import com.jcodeing.kmedia.definition.IMediaItem; 22 | import com.jcodeing.kmedia.definition.IPositionUnit; 23 | import com.jcodeing.kmedia.definition.IPositionUnitList; 24 | import com.jcodeing.kmedia.utils.Assert; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | 28 | public class MediaItem implements IMediaItem, IPositionUnitList, android.os.Parcelable { 29 | 30 | private String mediaId; 31 | private String mediaUri; 32 | 33 | private String title; 34 | private String description; 35 | private String iconUri; 36 | 37 | private List posUnitList; 38 | 39 | private Bundle extras; 40 | 41 | @Override 42 | public String getMediaId() { 43 | return mediaId; 44 | } 45 | 46 | @Override 47 | public Uri getMediaUri() { 48 | return mediaUri != null ? Uri.parse(mediaUri) : null; 49 | } 50 | 51 | @Override 52 | public CharSequence getTitle() { 53 | return title; 54 | } 55 | 56 | @Override 57 | public CharSequence getDescription() { 58 | return description; 59 | } 60 | 61 | @Override 62 | public Uri getIconUri() { 63 | return iconUri != null ? Uri.parse(iconUri) : null; 64 | } 65 | 66 | @Override 67 | public Bundle getExtras() { 68 | return extras; 69 | } 70 | 71 | // ============================@IPositionUnitList 72 | @Override 73 | public int positionUnitSize() { 74 | return posUnitList != null ? posUnitList.size() : 0; 75 | } 76 | 77 | @Override 78 | public long getStartPosition(int posUnitIndex) { 79 | return posUnitList != null && Assert.checkIndex(posUnitIndex, positionUnitSize()) ? 80 | posUnitList.get(posUnitIndex).getStartPos() : 0; 81 | } 82 | 83 | @Override 84 | public long getEndPosition(int posUnitIndex) { 85 | return posUnitList != null && Assert.checkIndex(posUnitIndex, positionUnitSize()) ? 86 | posUnitList.get(posUnitIndex).getEndPos() : Integer.MAX_VALUE; 87 | } 88 | 89 | public String getSubtitleEn(int posUnitIndex) { 90 | return posUnitList != null && Assert.checkIndex(posUnitIndex, positionUnitSize()) ? 91 | posUnitList.get(posUnitIndex).getEn() : null; 92 | } 93 | 94 | public String getSubtitleCn(int posUnitIndex) { 95 | return posUnitList != null && Assert.checkIndex(posUnitIndex, positionUnitSize()) ? 96 | posUnitList.get(posUnitIndex).getCn() : null; 97 | } 98 | 99 | // ============================@PosUnit 100 | public class PosUnit implements IPositionUnit { 101 | 102 | long start; 103 | long end; 104 | 105 | String cn; 106 | String en; 107 | 108 | @Override 109 | public long getStartPos() { 110 | return start; 111 | } 112 | 113 | @Override 114 | public long getEndPos() { 115 | return end; 116 | } 117 | 118 | public String getCn() { 119 | return cn; 120 | } 121 | 122 | public String getEn() { 123 | return en; 124 | } 125 | } 126 | 127 | 128 | // ============================@Parcelable 129 | @Override 130 | public int describeContents() { 131 | return 0; 132 | } 133 | 134 | @Override 135 | public void writeToParcel(Parcel dest, int flags) { 136 | dest.writeString(this.mediaId); 137 | dest.writeString(this.mediaUri); 138 | dest.writeString(this.title); 139 | dest.writeString(this.description); 140 | dest.writeString(this.iconUri); 141 | dest.writeList(this.posUnitList); 142 | dest.writeBundle(this.extras); 143 | } 144 | 145 | public MediaItem() { 146 | } 147 | 148 | protected MediaItem(Parcel in) { 149 | this.mediaId = in.readString(); 150 | this.mediaUri = in.readString(); 151 | this.title = in.readString(); 152 | this.description = in.readString(); 153 | this.iconUri = in.readString(); 154 | this.posUnitList = new ArrayList<>(); 155 | in.readList(this.posUnitList, PosUnit.class.getClassLoader()); 156 | this.extras = in.readBundle(getClass().getClassLoader()); 157 | } 158 | 159 | public static final Creator CREATOR = new Creator() { 160 | @Override 161 | public MediaItem createFromParcel(Parcel source) { 162 | return new MediaItem(source); 163 | } 164 | 165 | @Override 166 | public MediaItem[] newArray(int size) { 167 | return new MediaItem[size]; 168 | } 169 | }; 170 | } 171 | -------------------------------------------------------------------------------- /demo/src/main/java/com/jcodeing/kmedia/demo/assist/VideoQueueAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 K Sun 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.jcodeing.kmedia.demo.assist; 17 | 18 | import android.content.Context; 19 | import android.support.v7.widget.RecyclerView; 20 | import android.view.LayoutInflater; 21 | import android.view.View; 22 | import android.view.View.OnClickListener; 23 | import android.view.ViewGroup; 24 | import android.widget.TextView; 25 | import com.jcodeing.kmedia.adapter.MediaQueueRecyclerAdapter; 26 | import com.jcodeing.kmedia.definition.IMediaItem; 27 | import com.jcodeing.kmedia.demo.assist.VideoQueueAdapter.LocalViewHolder; 28 | import com.jcodeing.kmedia.demo.R; 29 | 30 | public class VideoQueueAdapter extends MediaQueueRecyclerAdapter { 31 | 32 | private final LayoutInflater inflater; 33 | private boolean isLand; 34 | 35 | public VideoQueueAdapter(Context context) { 36 | inflater = LayoutInflater.from(context); 37 | } 38 | 39 | public VideoQueueAdapter(Context context, boolean isLand) { 40 | inflater = LayoutInflater.from(context); 41 | this.isLand = isLand; 42 | } 43 | 44 | @Override 45 | public LocalViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 46 | return new LocalViewHolder( 47 | inflater.inflate(isLand ? R.layout.item_video_queue_land : R.layout.item_video_queue_port, 48 | parent, false)); 49 | } 50 | 51 | @Override 52 | public void onBindViewHolder(LocalViewHolder holder, int position) { 53 | holder.bindViewData(mediaQueue.getMediaItem(position), position); 54 | } 55 | 56 | class LocalViewHolder extends RecyclerView.ViewHolder implements OnClickListener { 57 | 58 | LocalViewHolder(View view) { 59 | super(view); 60 | view.setOnClickListener(this); 61 | } 62 | 63 | void bindViewData(IMediaItem mediaItem, int position) { 64 | ((TextView) itemView).setText(mediaItem.getTitle()); 65 | itemView.setSelected(position == mediaQueue.getCurrentIndex()); 66 | } 67 | 68 | @Override 69 | public void onClick(View v) { 70 | mediaQueue.skipToIndex(getLayoutPosition()); 71 | } 72 | } 73 | 74 | } -------------------------------------------------------------------------------- /demo/src/main/res/drawable-anydpi-v21/k_ic_close.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable-anydpi-v21/k_ic_ffwd.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable-anydpi-v21/k_ic_media.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable-anydpi-v21/k_ic_next.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable-anydpi-v21/k_ic_pause.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable-anydpi-v21/k_ic_play.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable-anydpi-v21/k_ic_prev.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable-anydpi-v21/k_ic_rew.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable-anydpi-v21/k_ic_volume_down.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable-anydpi-v21/k_ic_volume_mute.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable-anydpi-v21/k_ic_volume_up.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable-hdpi/k_ic_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-hdpi/k_ic_close.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-hdpi/k_ic_ffwd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-hdpi/k_ic_ffwd.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-hdpi/k_ic_media.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-hdpi/k_ic_media.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-hdpi/k_ic_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-hdpi/k_ic_next.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-hdpi/k_ic_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-hdpi/k_ic_pause.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-hdpi/k_ic_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-hdpi/k_ic_play.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-hdpi/k_ic_prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-hdpi/k_ic_prev.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-hdpi/k_ic_rew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-hdpi/k_ic_rew.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-hdpi/k_ic_volume_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-hdpi/k_ic_volume_down.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-hdpi/k_ic_volume_mute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-hdpi/k_ic_volume_mute.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-hdpi/k_ic_volume_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-hdpi/k_ic_volume_up.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-ldpi/k_ic_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-ldpi/k_ic_close.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-ldpi/k_ic_ffwd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-ldpi/k_ic_ffwd.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-ldpi/k_ic_media.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-ldpi/k_ic_media.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-ldpi/k_ic_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-ldpi/k_ic_next.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-ldpi/k_ic_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-ldpi/k_ic_pause.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-ldpi/k_ic_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-ldpi/k_ic_play.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-ldpi/k_ic_prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-ldpi/k_ic_prev.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-ldpi/k_ic_rew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-ldpi/k_ic_rew.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-ldpi/k_ic_volume_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-ldpi/k_ic_volume_down.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-ldpi/k_ic_volume_mute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-ldpi/k_ic_volume_mute.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-ldpi/k_ic_volume_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-ldpi/k_ic_volume_up.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-mdpi/k_ic_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-mdpi/k_ic_close.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-mdpi/k_ic_ffwd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-mdpi/k_ic_ffwd.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-mdpi/k_ic_media.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-mdpi/k_ic_media.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-mdpi/k_ic_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-mdpi/k_ic_next.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-mdpi/k_ic_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-mdpi/k_ic_pause.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-mdpi/k_ic_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-mdpi/k_ic_play.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-mdpi/k_ic_prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-mdpi/k_ic_prev.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-mdpi/k_ic_rew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-mdpi/k_ic_rew.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-mdpi/k_ic_volume_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-mdpi/k_ic_volume_down.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-mdpi/k_ic_volume_mute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-mdpi/k_ic_volume_mute.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-mdpi/k_ic_volume_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-mdpi/k_ic_volume_up.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xhdpi/k_ic_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xhdpi/k_ic_close.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xhdpi/k_ic_ffwd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xhdpi/k_ic_ffwd.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xhdpi/k_ic_media.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xhdpi/k_ic_media.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xhdpi/k_ic_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xhdpi/k_ic_next.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xhdpi/k_ic_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xhdpi/k_ic_pause.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xhdpi/k_ic_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xhdpi/k_ic_play.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xhdpi/k_ic_prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xhdpi/k_ic_prev.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xhdpi/k_ic_rew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xhdpi/k_ic_rew.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xhdpi/k_ic_volume_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xhdpi/k_ic_volume_down.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xhdpi/k_ic_volume_mute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xhdpi/k_ic_volume_mute.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xhdpi/k_ic_volume_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xhdpi/k_ic_volume_up.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xxhdpi/k_ic_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xxhdpi/k_ic_close.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xxhdpi/k_ic_ffwd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xxhdpi/k_ic_ffwd.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xxhdpi/k_ic_media.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xxhdpi/k_ic_media.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xxhdpi/k_ic_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xxhdpi/k_ic_next.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xxhdpi/k_ic_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xxhdpi/k_ic_pause.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xxhdpi/k_ic_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xxhdpi/k_ic_play.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xxhdpi/k_ic_prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xxhdpi/k_ic_prev.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xxhdpi/k_ic_rew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xxhdpi/k_ic_rew.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xxhdpi/k_ic_volume_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xxhdpi/k_ic_volume_down.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xxhdpi/k_ic_volume_mute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xxhdpi/k_ic_volume_mute.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable-xxhdpi/k_ic_volume_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/drawable-xxhdpi/k_ic_volume_up.png -------------------------------------------------------------------------------- /demo/src/main/res/drawable/bg_button_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 24 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/bg_button_stroke_accent.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 22 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/bg_button_stroke_primary.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 22 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/bg_player_lock_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 23 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/bg_radio_button_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 21 | 24 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/bg_video_queue_activity_oval.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 23 | 28 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/bg_video_queue_activity_rectangle.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/ic_brightness_down.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/ic_brightness_up.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/ic_ffwd_primary.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | 25 | 26 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/ic_go_back.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/ic_go_full_screen.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/ic_kmedia_logo.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 27 | 30 | 33 | 36 | 39 | 42 | 43 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/ic_menu_kmedia.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/ic_open_queue_menu.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/ic_pause_primary.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/ic_play_primary.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/ic_player_locked.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/ic_player_unlock.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/ic_rectangle_primary.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/ic_rew_primary.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 22 | 25 | 26 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/selector_ab_enable.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/selector_item_color_black.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /demo/src/main/res/drawable/selector_item_color_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/activity_about.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 32 | 41 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/activity_multiple_video.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 32 | 42 | 54 | 55 | 56 | 62 | 72 | 84 | 85 | 86 | 95 | 105 | 117 | 118 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/activity_queue_audio.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 23 | 24 | 29 | 30 | 36 | 37 | 40 | 47 | 52 | 53 | 54 | 61 | 69 | 78 | 79 | 80 | 88 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/activity_queue_video.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 22 | 23 | 24 | 29 | 34 | 38 | 39 | 40 | 41 | 45 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/activity_simple.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 20 | 21 | 26 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/ctrl_layer_custom_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 20 | 21 | 22 | 30 | 38 | 45 | 53 | 54 | 55 | 56 | 61 | 66 | 67 | 68 | 69 | 75 | 82 | 90 | 91 | 92 | 93 | 99 | 107 | 116 | 117 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/ctrl_layer_land_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 22 | 23 | 24 | 33 | 34 | 41 | 42 | 43 | 50 | 51 | 55 | 56 | 64 | 65 | 66 | 77 | 78 | 84 | 91 | 96 | 103 | 104 | 105 | 106 | 107 | 108 | 116 | 117 | 122 | 123 | 124 | 125 | 126 | 127 | 138 | 139 | 140 | 146 | 147 | 155 | 156 | 162 | 168 | 175 | 176 | 177 | 186 | 187 | 188 | 189 | 190 | 203 | 204 | 219 | 221 | 222 | 223 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/ctrl_layer_land_queue.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 21 | 22 | 31 | 32 | 39 | 40 | 41 | 48 | 49 | 53 | 54 | 62 | 63 | 64 | 75 | 76 | 83 | 84 | 85 | 86 | 91 | 92 | 93 | 99 | 108 | 109 | 118 | 119 | 128 | 129 | 138 | 139 | 140 | 141 | 148 | 152 | 162 | 163 | 164 | 165 | 166 | 171 | 172 | 173 | 174 | 180 | 181 | 194 | 195 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/ctrl_layer_port_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 22 | 23 | 34 | 35 | 36 | 42 | 49 | 54 | 61 | 62 | 63 | 64 | 65 | 73 | 74 | 83 | 84 | 95 | 96 | 97 | 98 | 103 | 112 | 113 | 120 | 121 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/floating_video_view_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 20 | 21 | 22 | 26 | 31 | 36 | 37 | 42 | 50 | 51 | 52 | 56 | 61 | 62 | 63 | 68 | 69 | 70 | 71 | 72 | 73 | 78 | 83 | 88 | 89 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/floating_video_view_multiple.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 20 | 21 | 22 | 26 | 31 | 37 | 38 | 43 | 51 | 52 | 53 | 60 | 68 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 88 | 93 | 98 | 99 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/item_audio_queue.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/item_video_queue_land.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/item_video_queue_port.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | -------------------------------------------------------------------------------- /demo/src/main/res/layout/nav_header_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 26 | 27 | -------------------------------------------------------------------------------- /demo/src/main/res/menu/drawer.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 22 | 26 | 30 | 34 | -------------------------------------------------------------------------------- /demo/src/main/res/menu/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /demo/src/main/res/menu/queue.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 23 | 26 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /demo/src/main/res/menu/simple.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 23 | 26 | 27 | -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/demo/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /demo/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 25 | 26 | -------------------------------------------------------------------------------- /demo/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | #666666 19 | #FF4081 20 | #D6D6D6 21 | #BBBCBC 22 | 23 | 24 | #77000000 25 | 26 | #77666666 27 | 28 | -------------------------------------------------------------------------------- /demo/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | Copyright © 2017 K Sun 18 | https://github.com/jcodeing/KMedia 19 | 20 | Demo 21 | About 22 | Open navigation drawer 23 | Close navigation drawer 24 | 25 | 26 | KMedia Demo 27 | A~ Queue `Binding `Notifier 28 | V~ Simple `Exo `AndroidMP 29 | V~ Queue `FullScreen `DIY 30 | V~ Multiple `Floating `Drag 31 | 32 | 33 | 1.0x 34 | EN 35 | 36 | 00:00 37 | 00:00 38 | / 39 | CtrlLayer1 40 | CtrlLayer2 41 | CtrlLayer3 42 | 43 | AB 44 | Start 45 | End 46 | Loop 47 | Interval 48 | 49 | Launch Floating Player View 50 | 51 | 52 | goBack 53 | goFullScreen 54 | playerLock 55 | openVideoQueueMenu 56 | 57 | 58 | Can you solve Einstein’s Riddle - Dan Van der Vieren 59 | Welcome To KMedia Demo 60 | KMedia 61 | 62 | V1 63 | V2 64 | V3 65 | V4 66 | V5 67 | V6 68 | 69 | ExoMediaPlayer 70 | AndroidMediaPlayer 71 | 72 | LIST_LOOP 73 | RANDOM 74 | SINGLE_LOOP 75 | SINGLE_ONCE 76 | 77 | -------------------------------------------------------------------------------- /demo/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 23 | 24 | 28 | 29 | 36 | 37 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcodeing/KMedia/67ef74c141549b0cb2fc930c4b18c6161545eea0/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /init_modules.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2017 K Sun 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | git clone -b develop https://github.com/jcodeing/KMedia-Core.git core 17 | git clone -b develop https://github.com/jcodeing/KMedia-Uie.git uie 18 | git clone -b develop https://github.com/jcodeing/KMedia-Mpe.git mpe 19 | -------------------------------------------------------------------------------- /readme/icon/kmedia_core_fork.svg: -------------------------------------------------------------------------------- 1 | 3 | // width(128) 4 | //|-------------------------------------| 5 | //| [A] | [B] |height(20) 6 | //|-------------------------------------| 7 | // centerX(39.5) centerX(103.5) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | //[A] background 17 | //[B] background 18 | 19 | 20 | 22 | //[A] text 23 | KMedia-Core 24 | KMedia-Core 25 | //[B] text 26 | Fork 27 | Fork 28 | 29 | -------------------------------------------------------------------------------- /readme/icon/kmedia_core_release.svg: -------------------------------------------------------------------------------- 1 | 3 | // width(128) 4 | //|-------------------------------------| 5 | //| [A] | [B] |height(20) 6 | //|-------------------------------------| 7 | // centerX(39.5) centerX(103.5) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | //[A] background 17 | //[B] background 18 | 19 | 20 | 22 | //[A] text 23 | KMedia-Core 24 | KMedia-Core 25 | //[B] text 26 | r1.x.x 27 | r1.x.x 28 | 29 | -------------------------------------------------------------------------------- /readme/icon/kmedia_exo_fork.svg: -------------------------------------------------------------------------------- 1 | 3 | // width(128) 4 | //|-------------------------------------| 5 | //| [A] | [B] |height(20) 6 | //|-------------------------------------| 7 | // centerX(39.5) centerX(103.5) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | //[A] background 17 | //[B] background 18 | 19 | 20 | 22 | //[A] text 23 | KMedia-Exo 24 | KMedia-Exo 25 | //[B] text 26 | Fork 27 | Fork 28 | 29 | -------------------------------------------------------------------------------- /readme/icon/kmedia_exo_release.svg: -------------------------------------------------------------------------------- 1 | 3 | // width(128) 4 | //|-------------------------------------| 5 | //| [A] | [B] |height(20) 6 | //|-------------------------------------| 7 | // centerX(39.5) centerX(103.5) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | //[A] background 17 | //[B] background 18 | 19 | 20 | 22 | //[A] text 23 | KMedia-Exo 24 | KMedia-Exo 25 | //[B] text 26 | r1.x.x 27 | r1.x.x 28 | 29 | -------------------------------------------------------------------------------- /readme/icon/kmedia_logo.svg: -------------------------------------------------------------------------------- 1 | kmedia_logo -------------------------------------------------------------------------------- /readme/icon/kmedia_uie_fork.svg: -------------------------------------------------------------------------------- 1 | 3 | // width(128) 4 | //|-------------------------------------| 5 | //| [A] | [B] |height(20) 6 | //|-------------------------------------| 7 | // centerX(39.5) centerX(103.5) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | //[A] background 17 | //[B] background 18 | 19 | 20 | 22 | //[A] text 23 | KMedia-Uie 24 | KMedia-Uie 25 | //[B] text 26 | Fork 27 | Fork 28 | 29 | -------------------------------------------------------------------------------- /readme/icon/kmedia_uie_release.svg: -------------------------------------------------------------------------------- 1 | 3 | // width(128) 4 | //|-------------------------------------| 5 | //| [A] | [B] |height(20) 6 | //|-------------------------------------| 7 | // centerX(39.5) centerX(103.5) 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | //[A] background 17 | //[B] background 18 | 19 | 20 | 22 | //[A] text 23 | KMedia-Uie 24 | KMedia-Uie 25 | //[B] text 26 | r1.x.x 27 | r1.x.x 28 | 29 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 K Sun 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | include ':demo' 15 | //include ':core', ':uie', ':exo' 16 | //project(':exo').projectDir = new File(settingsDir, 'mpe/exo') --------------------------------------------------------------------------------