├── .github └── workflows │ └── test.yml ├── .gitignore ├── .idea ├── .name ├── codeStyles │ └── Project.xml ├── compiler.xml ├── inspectionProfiles │ └── Project_Default.xml ├── jarRepositories.xml └── misc.xml ├── LICENSE ├── app ├── build.gradle ├── key_store ├── libs │ ├── commons-lang3-3.12.0.jar │ └── thunder.jar ├── proguard-rules.pro ├── schemas │ └── com.github.tvbox.osc.data.AppDataBase │ │ ├── 1.json │ │ └── 3.json └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ ├── epg_data.json │ ├── js │ │ └── lib │ │ │ ├── cheerio.min.js │ │ │ ├── crypto-js.js │ │ │ ├── dayjs.min.js │ │ │ ├── underscore-esm-min.js │ │ │ └── uri.min.js │ └── ua.db │ ├── java │ ├── com │ │ └── github │ │ │ ├── catvod │ │ │ └── crawler │ │ │ │ ├── JarLoader.java │ │ │ │ ├── JsLoader.java │ │ │ │ ├── Spider.java │ │ │ │ ├── SpiderDebug.java │ │ │ │ └── SpiderNull.java │ │ │ └── tvbox │ │ │ └── osc │ │ │ ├── api │ │ │ └── ApiConfig.java │ │ │ ├── base │ │ │ ├── App.java │ │ │ ├── BaseActivity.java │ │ │ └── BaseLazyFragment.java │ │ │ ├── bean │ │ │ ├── AbsJson.java │ │ │ ├── AbsSortJson.java │ │ │ ├── AbsSortXml.java │ │ │ ├── AbsXml.java │ │ │ ├── Epginfo.java │ │ │ ├── IJKCode.java │ │ │ ├── IpScanningVo.java │ │ │ ├── LiveChannelGroup.java │ │ │ ├── LiveChannelItem.java │ │ │ ├── LiveDayListGroup.java │ │ │ ├── LiveEpgDate.java │ │ │ ├── LivePlayerManager.java │ │ │ ├── LiveSettingGroup.java │ │ │ ├── LiveSettingItem.java │ │ │ ├── Movie.java │ │ │ ├── MovieSort.java │ │ │ ├── ParseBean.java │ │ │ ├── SourceBean.java │ │ │ ├── Subtitle.java │ │ │ ├── SubtitleData.java │ │ │ └── VodInfo.java │ │ │ ├── cache │ │ │ ├── Cache.java │ │ │ ├── CacheDao.java │ │ │ ├── CacheManager.java │ │ │ ├── RoomDataManger.java │ │ │ ├── VodCollect.java │ │ │ ├── VodCollectDao.java │ │ │ ├── VodRecord.java │ │ │ └── VodRecordDao.java │ │ │ ├── callback │ │ │ ├── EmptyCallback.java │ │ │ └── LoadingCallback.java │ │ │ ├── data │ │ │ ├── AppDataBase.java │ │ │ └── AppDataManager.java │ │ │ ├── event │ │ │ ├── HistoryStateEvent.java │ │ │ ├── RefreshEvent.java │ │ │ ├── ServerEvent.java │ │ │ └── TopStateEvent.java │ │ │ ├── picasso │ │ │ ├── MyOkhttpDownLoader.java │ │ │ └── RoundTransformation.java │ │ │ ├── player │ │ │ ├── IjkMediaPlayer.java │ │ │ ├── MyVideoView.java │ │ │ ├── TrackInfo.java │ │ │ ├── TrackInfoBean.java │ │ │ ├── controller │ │ │ │ ├── BaseController.java │ │ │ │ ├── LiveController.java │ │ │ │ └── VodController.java │ │ │ ├── render │ │ │ │ ├── SurfaceRenderView.java │ │ │ │ └── SurfaceRenderViewFactory.java │ │ │ └── thirdparty │ │ │ │ ├── Kodi.java │ │ │ │ ├── MXPlayer.java │ │ │ │ ├── ReexPlayer.java │ │ │ │ └── RemoteTVBox.java │ │ │ ├── receiver │ │ │ ├── CustomWebReceiver.java │ │ │ └── SearchReceiver.java │ │ │ ├── server │ │ │ ├── ControlManager.java │ │ │ ├── DataReceiver.java │ │ │ ├── InputRequestProcess.java │ │ │ ├── RawRequestProcess.java │ │ │ ├── RemoteServer.java │ │ │ ├── RequestProcess.java │ │ │ └── ShellUtils.java │ │ │ ├── subtitle │ │ │ ├── DefaultSubtitleEngine.java │ │ │ ├── SubtitleEngine.java │ │ │ ├── SubtitleFinder.java │ │ │ ├── SubtitleLoadSuccessResult.java │ │ │ ├── SubtitleLoader.java │ │ │ ├── UIRenderTask.java │ │ │ ├── exception │ │ │ │ └── FatalParsingException.java │ │ │ ├── format │ │ │ │ ├── FormatASS.java │ │ │ │ ├── FormatSCC.java │ │ │ │ ├── FormatSRT.java │ │ │ │ ├── FormatSTL.java │ │ │ │ ├── FormatTTML.java │ │ │ │ └── TimedTextFileFormat.java │ │ │ ├── model │ │ │ │ ├── Region.java │ │ │ │ ├── Style.java │ │ │ │ ├── Subtitle.java │ │ │ │ ├── Time.java │ │ │ │ └── TimedTextObject.java │ │ │ ├── runtime │ │ │ │ ├── AppTaskExecutor.java │ │ │ │ ├── DefaultTaskExecutor.java │ │ │ │ └── TaskExecutor.java │ │ │ └── widget │ │ │ │ └── SimpleSubtitleView.java │ │ │ ├── ui │ │ │ ├── activity │ │ │ │ ├── CollectActivity.java │ │ │ │ ├── DetailActivity.java │ │ │ │ ├── FastSearchActivity.java │ │ │ │ ├── HistoryActivity.java │ │ │ │ ├── HomeActivity.java │ │ │ │ ├── LivePlayActivity.java │ │ │ │ ├── PlayActivity.java │ │ │ │ ├── PushActivity.java │ │ │ │ ├── SearchActivity.java │ │ │ │ └── SettingActivity.java │ │ │ ├── adapter │ │ │ │ ├── ApiHistoryDialogAdapter.java │ │ │ │ ├── BackupAdapter.java │ │ │ │ ├── CheckboxSearchAdapter.java │ │ │ │ ├── CollectAdapter.java │ │ │ │ ├── FastListAdapter.java │ │ │ │ ├── FastSearchAdapter.java │ │ │ │ ├── GridAdapter.java │ │ │ │ ├── GridFilterKVAdapter.java │ │ │ │ ├── HistoryAdapter.java │ │ │ │ ├── HomeHotVodAdapter.java │ │ │ │ ├── HomePageAdapter.java │ │ │ │ ├── LiveChannelGroupAdapter.java │ │ │ │ ├── LiveChannelItemAdapter.java │ │ │ │ ├── LiveEpgAdapter.java │ │ │ │ ├── LiveEpgDateAdapter.java │ │ │ │ ├── LiveSettingGroupAdapter.java │ │ │ │ ├── LiveSettingItemAdapter.java │ │ │ │ ├── MyEpgAdapter.java │ │ │ │ ├── ParseAdapter.java │ │ │ │ ├── PinyinAdapter.java │ │ │ │ ├── QuickSearchAdapter.java │ │ │ │ ├── SearchAdapter.java │ │ │ │ ├── SearchSubtitleAdapter.java │ │ │ │ ├── SearchWordAdapter.java │ │ │ │ ├── SelectDialogAdapter.java │ │ │ │ ├── SeriesAdapter.java │ │ │ │ ├── SeriesFlagAdapter.java │ │ │ │ ├── SettingMenuAdapter.java │ │ │ │ ├── SettingPageAdapter.java │ │ │ │ └── SortAdapter.java │ │ │ ├── dialog │ │ │ │ ├── AboutDialog.java │ │ │ │ ├── ApiDialog.java │ │ │ │ ├── ApiHistoryDialog.java │ │ │ │ ├── BackupDialog.java │ │ │ │ ├── BaseDialog.java │ │ │ │ ├── GridFilterDialog.java │ │ │ │ ├── LivePasswordDialog.java │ │ │ │ ├── QuickSearchDialog.java │ │ │ │ ├── RemoteDialog.java │ │ │ │ ├── SearchCheckboxDialog.java │ │ │ │ ├── SearchRemoteTvDialog.java │ │ │ │ ├── SearchSubtitleDialog.java │ │ │ │ ├── SelectDialog.java │ │ │ │ ├── SubtitleDialog.java │ │ │ │ ├── TipDialog.java │ │ │ │ └── XWalkInitDialog.java │ │ │ ├── fragment │ │ │ │ ├── GridFragment.java │ │ │ │ ├── ModelSettingFragment.java │ │ │ │ ├── PlayFragment.java │ │ │ │ └── UserFragment.java │ │ │ └── tv │ │ │ │ ├── QRCodeGen.java │ │ │ │ └── widget │ │ │ │ ├── AudioWaveView.java │ │ │ │ ├── ChannelListView.java │ │ │ │ ├── DefaultTransformer.java │ │ │ │ ├── FixedSpeedScroller.java │ │ │ │ ├── LoadMoreView.java │ │ │ │ ├── MarqueeTextView.java │ │ │ │ ├── NoScrollViewPager.java │ │ │ │ ├── SearchKeyboard.java │ │ │ │ └── ViewObj.java │ │ │ ├── util │ │ │ ├── AES.java │ │ │ ├── AdBlocker.java │ │ │ ├── AppManager.java │ │ │ ├── CharsetUtils.java │ │ │ ├── DefaultConfig.java │ │ │ ├── EpgNameFuzzyMatch.java │ │ │ ├── EpgUtil.java │ │ │ ├── FastClickCheckUtil.java │ │ │ ├── FileUtils.java │ │ │ ├── HawkConfig.java │ │ │ ├── HistoryHelper.java │ │ │ ├── IpScanning.java │ │ │ ├── LOG.java │ │ │ ├── MD5.java │ │ │ ├── OkGoHelper.java │ │ │ ├── PlayerHelper.java │ │ │ ├── SSL │ │ │ │ └── SSLSocketFactoryCompat.java │ │ │ ├── ScreenUtils.java │ │ │ ├── SearchHelper.java │ │ │ ├── SubtitleHelper.java │ │ │ ├── TLSSocketFactory.java │ │ │ ├── UA.java │ │ │ ├── UnicodeReader.java │ │ │ ├── VideoParseRuler.java │ │ │ ├── XWalkUtils.java │ │ │ ├── js │ │ │ │ ├── HtmlParser.java │ │ │ │ ├── JSEngine.java │ │ │ │ ├── SpiderJS.java │ │ │ │ └── UTF8BOMFighter.java │ │ │ ├── live │ │ │ │ └── TxtSubscribe.java │ │ │ ├── thunder │ │ │ │ └── Thunder.java │ │ │ └── urlhttp │ │ │ │ ├── AESUtil.java │ │ │ │ ├── CallBackUtil.java │ │ │ │ ├── RealRequest.java │ │ │ │ ├── RealResponse.java │ │ │ │ ├── RequestUtil.java │ │ │ │ ├── ThreadsManager.java │ │ │ │ └── UrlHttpUtil.java │ │ │ └── viewmodel │ │ │ ├── SourceViewModel.java │ │ │ └── SubtitleViewModel.java │ └── okhttp3 │ │ └── dnsoverhttps │ │ ├── BootstrapDns.java │ │ ├── DnsOverHttps.java │ │ └── DnsRecordCodec.java │ └── res │ ├── drawable-hdpi │ └── app_icon.png │ ├── drawable-xhdpi │ ├── app_icon.png │ ├── vod_pause.png │ └── vod_play.png │ ├── drawable-xxhdpi │ └── app_icon.png │ ├── drawable-xxxhdpi │ └── app_icon.png │ ├── drawable │ ├── anim_loading.xml │ ├── app_banner.png │ ├── app_bg.png │ ├── bg_channel_list.xml │ ├── bg_progress_bar_out.xml │ ├── box_controller_top_bg.xml │ ├── button_detail_collect.xml │ ├── button_detail_play.xml │ ├── button_detail_quick_search.xml │ ├── button_detail_sort.xml │ ├── button_dialog_main.xml │ ├── button_home_sort_focus.xml │ ├── icon_back.png │ ├── icon_collect.xml │ ├── icon_delete.xml │ ├── icon_empty.png │ ├── icon_error.xml │ ├── icon_filter.xml │ ├── icon_filter_color.xml │ ├── icon_history.xml │ ├── icon_img_placeholder.png │ ├── icon_live.xml │ ├── icon_loading.png │ ├── icon_play.png │ ├── icon_pre.png │ ├── icon_push.xml │ ├── icon_search.xml │ ├── icon_setting.xml │ ├── icon_video.png │ ├── img_loading_placeholder.xml │ ├── input_dialog_api_input.xml │ ├── input_search.xml │ ├── item_bg_selector_left.xml │ ├── item_bg_selector_right.xml │ ├── item_right_bg.xml │ ├── preview_player_block.xml │ ├── scrollview.png │ ├── scrollviewleft.png │ ├── seekbar_style.xml │ ├── seekbar_thumb_normal.xml │ ├── seekbar_thumb_pressed.xml │ ├── shape_dialog_bg_main.xml │ ├── shape_dialog_filter_bg.xml │ ├── shape_dialog_pg_search_checkbox.xml │ ├── shape_live_channel_num.xml │ ├── shape_live_focus.xml │ ├── shape_live_select.xml │ ├── shape_play_bottom.xml │ ├── shape_play_mobile_center.xml │ ├── shape_player_control_vod_seek.xml │ ├── shape_player_control_vod_seek_thumb.xml │ ├── shape_player_control_vod_seek_thumb_normal.xml │ ├── shape_player_control_vod_seek_thumb_press.xml │ ├── shape_setting_model_focus.xml │ ├── shape_setting_sort_focus.xml │ ├── shape_source_flag_focus.xml │ ├── shape_source_flag_line.xml │ ├── shape_source_focus.xml │ ├── shape_source_series_focus.xml │ ├── shape_thumb_bottom_name.xml │ ├── shape_thumb_lang.xml │ ├── shape_thumb_note.xml │ ├── shape_thumb_year.xml │ ├── shape_user_focus.xml │ ├── shape_user_search.xml │ └── transparent.xml │ ├── layout │ ├── activity_collect.xml │ ├── activity_detail.xml │ ├── activity_fast_search.xml │ ├── activity_history.xml │ ├── activity_home.xml │ ├── activity_live_play.xml │ ├── activity_play.xml │ ├── activity_push.xml │ ├── activity_search.xml │ ├── activity_setting.xml │ ├── box_vod_control_view.xml │ ├── dialog_about.xml │ ├── dialog_api.xml │ ├── dialog_api_history.xml │ ├── dialog_backup.xml │ ├── dialog_checkbox_search.xml │ ├── dialog_grid_filter.xml │ ├── dialog_live_password.xml │ ├── dialog_quick_search.xml │ ├── dialog_remote.xml │ ├── dialog_search_remotetv.xml │ ├── dialog_search_subtitle.xml │ ├── dialog_select.xml │ ├── dialog_subtitle.xml │ ├── dialog_tip.xml │ ├── dialog_xwalk.xml │ ├── epglist_item.xml │ ├── fragment_grid.xml │ ├── fragment_model.xml │ ├── fragment_user.xml │ ├── item_dialog_api_history.xml │ ├── item_dialog_backup.xml │ ├── item_dialog_checkbox_search.xml │ ├── item_dialog_select.xml │ ├── item_grid.xml │ ├── item_grid_filter.xml │ ├── item_grid_filter_value.xml │ ├── item_home_sort.xml │ ├── item_keyboard.xml │ ├── item_list.xml │ ├── item_live.xml │ ├── item_live_channel.xml │ ├── item_live_channel_group.xml │ ├── item_live_setting.xml │ ├── item_live_setting_group.xml │ ├── item_play_parse.xml │ ├── item_quick_search_lite.xml │ ├── item_search.xml │ ├── item_search_lite.xml │ ├── item_search_subtitle_result.xml │ ├── item_search_word_hot.xml │ ├── item_search_word_split.xml │ ├── item_series.xml │ ├── item_series_flag.xml │ ├── item_series_group.xml │ ├── item_setting_menu.xml │ ├── item_user_hot_vod.xml │ ├── item_view_load_more.xml │ ├── layout_keyborad.xml │ ├── loadsir_empty_layout.xml │ ├── loadsir_loading_layout.xml │ ├── player_live_control_view.xml │ └── player_vod_control_view.xml │ ├── raw │ ├── index.html │ ├── jquery.js │ ├── script.js │ ├── style.css │ └── ui.css │ ├── values │ ├── attrs.xml │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml │ └── xml │ ├── file_paths.xml │ └── network_security_config.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── player ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ ├── tv │ │ └── danmaku │ │ │ └── ijk │ │ │ └── media │ │ │ ├── player │ │ │ ├── AbstractMediaPlayer.java │ │ │ ├── AndroidMediaPlayer.java │ │ │ ├── IMediaPlayer.java │ │ │ ├── ISurfaceTextureHolder.java │ │ │ ├── ISurfaceTextureHost.java │ │ │ ├── IjkLibLoader.java │ │ │ ├── IjkMediaCodecInfo.java │ │ │ ├── IjkMediaMeta.java │ │ │ ├── IjkMediaPlayer.java │ │ │ ├── IjkTimedText.java │ │ │ ├── MediaInfo.java │ │ │ ├── MediaPlayerProxy.java │ │ │ ├── TextureMediaPlayer.java │ │ │ ├── annotations │ │ │ │ ├── AccessedByNative.java │ │ │ │ └── CalledByNative.java │ │ │ ├── demo │ │ │ │ └── IjkDemoActivity.java │ │ │ ├── exceptions │ │ │ │ └── IjkMediaException.java │ │ │ ├── ffmpeg │ │ │ │ └── FFmpegApi.java │ │ │ ├── misc │ │ │ │ ├── AndroidMediaFormat.java │ │ │ │ ├── AndroidTrackInfo.java │ │ │ │ ├── IAndroidIO.java │ │ │ │ ├── IMediaDataSource.java │ │ │ │ ├── IMediaFormat.java │ │ │ │ ├── ITrackInfo.java │ │ │ │ ├── IjkMediaFormat.java │ │ │ │ └── IjkTrackInfo.java │ │ │ └── pragma │ │ │ │ ├── DebugLog.java │ │ │ │ └── Pragma.java │ │ │ └── player_armv7a │ │ │ └── Pragma.java │ └── xyz │ │ └── doikki │ │ └── videoplayer │ │ ├── aliplayer │ │ ├── AliMediaPlayer.java │ │ └── AliyunMediaPlayerFactory.java │ │ ├── controller │ │ ├── BaseVideoController.java │ │ ├── ControlWrapper.java │ │ ├── GestureVideoController.java │ │ ├── IControlComponent.java │ │ ├── IGestureComponent.java │ │ ├── IVideoController.java │ │ ├── MediaPlayerControl.java │ │ └── OrientationHelper.java │ │ ├── exo │ │ ├── ExoMediaPlayer.java │ │ ├── ExoMediaPlayerFactory.java │ │ └── ExoMediaSourceHelper.java │ │ ├── ijk │ │ ├── IjkPlayer.java │ │ ├── IjkPlayerFactory.java │ │ └── RawDataSourceProvider.java │ │ ├── player │ │ ├── AbstractPlayer.java │ │ ├── AndroidMediaPlayer.java │ │ ├── AndroidMediaPlayerFactory.java │ │ ├── AudioFocusHelper.java │ │ ├── PlayerFactory.java │ │ ├── ProgressManager.java │ │ ├── VideoView.java │ │ ├── VideoViewConfig.java │ │ └── VideoViewManager.java │ │ ├── render │ │ ├── IRenderView.java │ │ ├── MeasureHelper.java │ │ ├── RenderViewFactory.java │ │ ├── TextureRenderView.java │ │ └── TextureRenderViewFactory.java │ │ └── util │ │ ├── CutoutUtil.java │ │ ├── L.java │ │ └── PlayerUtils.java │ ├── jniLibs │ └── armeabi-v7a │ │ ├── libijkffmpeg.so │ │ ├── libijksdl.so │ │ ├── libplayer.so │ │ ├── libxl_stat.so │ │ └── libxl_thunder_sdk.so │ └── res │ ├── layout │ └── ijk_demo_activity.xml │ └── values │ ├── attrs.xml │ └── strings.xml ├── quickjs ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── github │ │ └── tvbox │ │ └── quickjs │ │ ├── JSArray.java │ │ ├── JSCallFunction.java │ │ ├── JSFunction.java │ │ ├── JSMethod.java │ │ ├── JSModule.java │ │ ├── JSObject.java │ │ ├── JSUtils.java │ │ ├── NativeCleaner.java │ │ ├── QuickJSContext.java │ │ └── QuickJSException.java │ └── jniLibs │ └── armeabi-v7a │ └── libquickjs.so └── settings.gradle /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test Build 2 | 3 | on: 4 | # push: 5 | # branches: 6 | # - main 7 | # pull_request: 8 | workflow_dispatch: 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v3 15 | with: 16 | fetch-depth: 0 17 | - name: Build With Gradle 18 | run: | 19 | chmod +x gradlew 20 | ./gradlew assemblerelease --build-cache --parallel --daemon --warning-mode all 21 | - name: Prepare App 22 | run: | 23 | mkdir -p ${{ github.workspace }}/apk/ 24 | for file in `find ~ -name "*.apk" -print`; do 25 | mv "$file" ${{ github.workspace }}/apk/ 26 | done 27 | - name: Upload App To Artifact 28 | uses: actions/upload-artifact@v3 29 | with: 30 | name: com.github.tvbox.osc 31 | path: ${{ github.workspace }}/apk/* 32 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | TVBox -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 36 | -------------------------------------------------------------------------------- /app/key_store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/key_store -------------------------------------------------------------------------------- /app/libs/commons-lang3-3.12.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/libs/commons-lang3-3.12.0.jar -------------------------------------------------------------------------------- /app/libs/thunder.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/libs/thunder.jar -------------------------------------------------------------------------------- /app/src/main/assets/ua.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/src/main/assets/ua.db -------------------------------------------------------------------------------- /app/src/main/java/com/github/catvod/crawler/JsLoader.java: -------------------------------------------------------------------------------- 1 | package com.github.catvod.crawler; 2 | 3 | import com.github.tvbox.osc.base.App; 4 | import com.github.tvbox.osc.util.js.SpiderJS; 5 | 6 | import java.util.concurrent.ConcurrentHashMap; 7 | 8 | public class JsLoader { 9 | private ConcurrentHashMap spiders = new ConcurrentHashMap<>(); 10 | 11 | public Spider getSpider(String key, String cls, String ext, String jar) { 12 | if (spiders.containsKey(key)) 13 | return spiders.get(key); 14 | try { 15 | SpiderJS sp = new SpiderJS(key, cls, ext); 16 | sp.init(App.getInstance(), ext); 17 | spiders.put(key, sp); 18 | return sp; 19 | } catch (Throwable th) { 20 | th.printStackTrace(); 21 | } 22 | return new SpiderNull(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/catvod/crawler/SpiderDebug.java: -------------------------------------------------------------------------------- 1 | package com.github.catvod.crawler; 2 | 3 | public class SpiderDebug { 4 | public static void log(Throwable th) { 5 | try { 6 | android.util.Log.d("SpiderLog", th.getMessage(), th); 7 | } catch (Throwable th1) { 8 | 9 | } 10 | } 11 | 12 | public static void log(String msg) { 13 | try { 14 | android.util.Log.d("SpiderLog", msg); 15 | } catch (Throwable th1) { 16 | 17 | } 18 | } 19 | 20 | public static String ec(int i) { 21 | return ""; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/catvod/crawler/SpiderNull.java: -------------------------------------------------------------------------------- 1 | package com.github.catvod.crawler; 2 | 3 | public class SpiderNull extends Spider { 4 | } 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/AbsSortJson.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | 5 | import java.io.Serializable; 6 | import java.util.ArrayList; 7 | 8 | public class AbsSortJson implements Serializable { 9 | 10 | @SerializedName(value = "class") 11 | public ArrayList classes; 12 | 13 | @SerializedName(value = "list") 14 | public ArrayList list; 15 | 16 | public AbsSortXml toAbsSortXml() { 17 | AbsSortXml absSortXml = new AbsSortXml(); 18 | MovieSort movieSort = new MovieSort(); 19 | movieSort.sortList = new ArrayList<>(); 20 | for (AbsJsonClass cls : classes) { 21 | MovieSort.SortData sortData = new MovieSort.SortData(); 22 | sortData.id = cls.type_id; 23 | sortData.name = cls.type_name; 24 | sortData.flag = cls.type_flag; 25 | movieSort.sortList.add(sortData); 26 | } 27 | if (list != null && !list.isEmpty()) { 28 | Movie movie = new Movie(); 29 | ArrayList videos = new ArrayList<>(); 30 | for (AbsJson.AbsJsonVod vod : list) { 31 | videos.add(vod.toXmlVideo()); 32 | } 33 | movie.videoList = videos; 34 | absSortXml.list = movie; 35 | } else { 36 | absSortXml.list = null; 37 | } 38 | absSortXml.classes = movieSort; 39 | return absSortXml; 40 | } 41 | 42 | public class AbsJsonClass implements Serializable { 43 | public String type_id; 44 | public String type_name; 45 | public String type_flag; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/AbsSortXml.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | import java.io.Serializable; 6 | import java.util.List; 7 | 8 | /** 9 | * @author pj567 10 | * @date :2020/12/18 11 | * @description: 12 | */ 13 | @XStreamAlias("rss") 14 | public class AbsSortXml implements Serializable { 15 | @XStreamAlias("class") 16 | public MovieSort classes; 17 | 18 | @XStreamAlias("list") 19 | public Movie list; 20 | 21 | public List videoList; 22 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/AbsXml.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * @author pj567 9 | * @date :2020/12/18 10 | * @description: 11 | */ 12 | @XStreamAlias("rss") 13 | public class AbsXml implements Serializable { 14 | @XStreamAlias("list") 15 | public Movie movie; 16 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/IJKCode.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | import com.github.tvbox.osc.util.HawkConfig; 4 | import com.orhanobut.hawk.Hawk; 5 | 6 | import java.util.LinkedHashMap; 7 | 8 | /** 9 | * @author pj567 10 | * @date :2021/3/8 11 | * @description: 12 | */ 13 | public class IJKCode { 14 | private String name; 15 | private LinkedHashMap option; 16 | private boolean selected; 17 | 18 | public void selected(boolean selected) { 19 | this.selected = selected; 20 | if (selected) { 21 | Hawk.put(HawkConfig.IJK_CODEC, name); 22 | } 23 | } 24 | 25 | public boolean isSelected() { 26 | return selected; 27 | } 28 | 29 | public String getName() { 30 | return name; 31 | } 32 | 33 | public void setName(String name) { 34 | this.name = name; 35 | } 36 | 37 | public LinkedHashMap getOption() { 38 | return option; 39 | } 40 | 41 | public void setOption(LinkedHashMap option) { 42 | this.option = option; 43 | } 44 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/IpScanningVo.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | public class IpScanningVo { 4 | 5 | private String hostName; 6 | private String ip; 7 | 8 | public IpScanningVo(String hostName, String ip) { 9 | this.hostName = hostName; 10 | this.ip = ip; 11 | } 12 | 13 | public String getHostName() { 14 | return hostName; 15 | } 16 | 17 | public void setHostName(String hostName) { 18 | this.hostName = hostName; 19 | } 20 | 21 | public String getIp() { 22 | return ip; 23 | } 24 | 25 | public void setIp(String ip) { 26 | this.ip = ip; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/LiveChannelGroup.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | import java.util.ArrayList; 4 | 5 | public class LiveChannelGroup { 6 | /** 7 | * groupIndex : 分组索引号 8 | * groupName : 分组名称 9 | * password : 分组密码 10 | */ 11 | private int groupIndex; 12 | private String groupName; 13 | private String groupPassword; 14 | private ArrayList liveChannelItems; 15 | 16 | public int getGroupIndex() { 17 | return groupIndex; 18 | } 19 | 20 | public void setGroupIndex(int groupIndex) { 21 | this.groupIndex = groupIndex; 22 | } 23 | 24 | public String getGroupName() { 25 | return groupName; 26 | } 27 | 28 | public void setGroupName(String groupName) { 29 | this.groupName = groupName; 30 | } 31 | 32 | public ArrayList getLiveChannels() { 33 | return liveChannelItems; 34 | } 35 | 36 | public void setLiveChannels(ArrayList liveChannelItems) { 37 | this.liveChannelItems = liveChannelItems; 38 | } 39 | 40 | public String getGroupPassword() { 41 | return groupPassword; 42 | } 43 | 44 | public void setGroupPassword(String groupPassword) { 45 | this.groupPassword = groupPassword; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/LiveDayListGroup.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | public class LiveDayListGroup { 4 | private int groupIndex; 5 | private String groupName; 6 | 7 | 8 | public int getGroupIndex() { 9 | return groupIndex; 10 | } 11 | 12 | public void setGroupIndex(int groupIndex) { 13 | this.groupIndex = groupIndex; 14 | } 15 | 16 | public String getGroupName() { 17 | return groupName; 18 | } 19 | 20 | public void setGroupName(String groupName) { 21 | this.groupName = groupName; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/LiveEpgDate.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | import java.util.ArrayList; 3 | import java.util.Date; 4 | 5 | public class LiveEpgDate { 6 | 7 | private int index; 8 | private String datePresented; 9 | private Date dateParamVal; 10 | 11 | public int getIndex() { 12 | return index; 13 | } 14 | 15 | public void setIndex(int index) { 16 | this.index = index; 17 | } 18 | 19 | public String getDatePresented() { 20 | return datePresented; 21 | } 22 | 23 | public void setDatePresented(String datePresented) { 24 | this.datePresented = datePresented; 25 | } 26 | 27 | public Date getDateParamVal() { 28 | return dateParamVal; 29 | } 30 | 31 | public void setDateParamVal(Date dateParamVal) { 32 | this.dateParamVal = dateParamVal; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/LiveSettingGroup.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | import java.util.ArrayList; 4 | 5 | public class LiveSettingGroup { 6 | private int groupIndex; 7 | private String groupName; 8 | private ArrayList liveSettingItems; 9 | 10 | public int getGroupIndex() { 11 | return groupIndex; 12 | } 13 | 14 | public void setGroupIndex(int groupIndex) { 15 | this.groupIndex = groupIndex; 16 | } 17 | 18 | public String getGroupName() { 19 | return groupName; 20 | } 21 | 22 | public void setGroupName(String groupName) { 23 | this.groupName = groupName; 24 | } 25 | 26 | public ArrayList getLiveSettingItems() { 27 | return liveSettingItems; 28 | } 29 | 30 | public void setLiveSettingItems(ArrayList liveSettingItems) { 31 | this.liveSettingItems = liveSettingItems; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/LiveSettingItem.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | /** 4 | * @author pj567 5 | * @date :2021/1/12 6 | * @description: 7 | */ 8 | public class LiveSettingItem { 9 | private int itemIndex; 10 | private String itemName; 11 | private boolean itemSelected = false; 12 | 13 | public int getItemIndex() { 14 | return itemIndex; 15 | } 16 | 17 | public void setItemIndex(int itemIndex) { 18 | this.itemIndex = itemIndex; 19 | } 20 | 21 | public String getItemName() { 22 | return itemName; 23 | } 24 | 25 | public void setItemName(String itemName) { 26 | this.itemName = itemName; 27 | } 28 | 29 | public boolean isItemSelected() { 30 | return itemSelected; 31 | } 32 | 33 | public void setItemSelected(boolean itemSelected) { 34 | this.itemSelected = itemSelected; 35 | } 36 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/ParseBean.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | import android.util.Base64; 4 | 5 | import com.github.tvbox.osc.util.DefaultConfig; 6 | 7 | /** 8 | * @author pj567 9 | * @date :2021/3/8 10 | * @description: 11 | */ 12 | public class ParseBean { 13 | 14 | private String name; 15 | private String url; 16 | private String ext; 17 | private int type; // 0 普通嗅探 1 json 2 Json扩展 3 聚合 18 | 19 | private boolean isDefault = false; 20 | 21 | public String getName() { 22 | return name; 23 | } 24 | 25 | public void setName(String name) { 26 | this.name = name; 27 | } 28 | 29 | public String getUrl() { 30 | return DefaultConfig.checkReplaceProxy(url); 31 | } 32 | 33 | public void setUrl(String url) { 34 | this.url = url; 35 | } 36 | 37 | public boolean isDefault() { 38 | return isDefault; 39 | } 40 | 41 | public void setDefault(boolean b) { 42 | isDefault = b; 43 | } 44 | 45 | public int getType() { 46 | return type; 47 | } 48 | 49 | public void setType(int type) { 50 | this.type = type; 51 | } 52 | 53 | public String getExt() { 54 | return ext; 55 | } 56 | 57 | public void setExt(String ext) { 58 | this.ext = ext; 59 | } 60 | 61 | public String mixUrl() { 62 | if (!ext.isEmpty()) { 63 | int idx = url.indexOf("?"); 64 | if (idx > 0) { 65 | return url.substring(0, idx + 1) + "cat_ext=" + Base64.encodeToString(ext.getBytes(), Base64.DEFAULT | Base64.URL_SAFE | Base64.NO_WRAP) + "&" + url.substring(idx + 1); 66 | } 67 | } 68 | return url; 69 | } 70 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/Subtitle.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | public class Subtitle { 4 | 5 | private String name; 6 | 7 | private String url; 8 | 9 | private boolean isZip; 10 | 11 | public boolean getIsZip() { 12 | return isZip; 13 | } 14 | 15 | public String getName() { 16 | return name; 17 | } 18 | 19 | public String getUrl() { 20 | return url; 21 | } 22 | 23 | public void setName(String name) { 24 | this.name = name; 25 | } 26 | 27 | public void setUrl(String url) { 28 | this.url = url; 29 | } 30 | 31 | public void setIsZip(boolean zip) { 32 | isZip = zip; 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return "Subtitle{" + 38 | "name='" + name + '\'' + 39 | ", url='" + url + '\'' + 40 | ", isZip=" + isZip + 41 | '}'; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/bean/SubtitleData.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.bean; 2 | 3 | import java.util.List; 4 | 5 | public class SubtitleData { 6 | 7 | private Boolean isNew; 8 | 9 | private List subtitleList; 10 | 11 | private Boolean isZip; 12 | 13 | public Boolean getIsNew() { 14 | return isNew; 15 | } 16 | 17 | public List getSubtitleList() { 18 | return subtitleList; 19 | } 20 | 21 | public Boolean getIsZip() { 22 | return isZip; 23 | } 24 | 25 | public void setIsNew(Boolean isNew) { 26 | this.isNew = isNew; 27 | } 28 | 29 | public void setSubtitleList(List subtitle) { 30 | this.subtitleList = subtitle; 31 | } 32 | 33 | public void setIsZip(Boolean zip) { 34 | isZip = zip; 35 | } 36 | 37 | @Override 38 | public String toString() { 39 | return "SubtitleData{" + 40 | "isNew='" + isNew + '\'' + 41 | '}'; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/cache/Cache.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.cache; 2 | 3 | import androidx.annotation.NonNull; 4 | import androidx.room.Entity; 5 | import androidx.room.PrimaryKey; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | * 类描述: 11 | * 12 | * @author pj567 13 | * @since 2020/5/15 14 | */ 15 | @Entity(tableName = "cache") 16 | public class Cache implements Serializable { 17 | @PrimaryKey(autoGenerate = false) 18 | @NonNull 19 | public String key; 20 | public byte[] data; 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/cache/CacheDao.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.cache; 2 | 3 | import androidx.room.Dao; 4 | import androidx.room.Delete; 5 | import androidx.room.Insert; 6 | import androidx.room.OnConflictStrategy; 7 | import androidx.room.Query; 8 | import androidx.room.Update; 9 | 10 | /** 11 | * 类描述: 12 | * 13 | * @author pj567 14 | * @since 2020/5/15 15 | */ 16 | @Dao 17 | public interface CacheDao { 18 | @Insert(onConflict = OnConflictStrategy.REPLACE) 19 | long save(Cache cache); 20 | 21 | /** 22 | * 注意,冒号后面必须紧跟参数名,中间不能有空格。大于小于号和冒号中间是有空格的。 23 | * select *from cache where【表中列名】 =:【参数名】------>等于 24 | * where 【表中列名】 < :【参数名】 小于 25 | * where 【表中列名】 between :【参数名1】 and :【参数2】------->这个区间 26 | * where 【表中列名】like :参数名----->模糊查询 27 | * where 【表中列名】 in (:【参数名集合】)---->查询符合集合内指定字段值的记录 28 | * 29 | * @param key 30 | * @return 31 | */ 32 | 33 | //如果是一对多,这里可以写List 34 | @Query("select *from cache where `key`=:key") 35 | Cache getCache(String key); 36 | 37 | //只能传递对象昂,删除时根据Cache中的主键 来比对的 38 | @Delete 39 | int delete(Cache cache); 40 | 41 | //只能传递对象昂,删除时根据Cache中的主键 来比对的 42 | @Update(onConflict = OnConflictStrategy.REPLACE) 43 | int update(Cache cache); 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/cache/VodCollect.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.cache; 2 | 3 | import androidx.room.ColumnInfo; 4 | import androidx.room.Entity; 5 | import androidx.room.PrimaryKey; 6 | 7 | import java.io.Serializable; 8 | 9 | @Entity(tableName = "vodCollect") 10 | public class VodCollect implements Serializable { 11 | @PrimaryKey(autoGenerate = true) 12 | private int id; 13 | @ColumnInfo(name = "vodId") 14 | public String vodId; 15 | @ColumnInfo(name = "updateTime") 16 | public long updateTime; 17 | @ColumnInfo(name = "sourceKey") 18 | public String sourceKey; 19 | @ColumnInfo(name = "name") 20 | public String name; 21 | @ColumnInfo(name = "pic") 22 | public String pic; 23 | 24 | public int getId() { 25 | return id; 26 | } 27 | 28 | public void setId(int id) { 29 | this.id = id; 30 | } 31 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/cache/VodCollectDao.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.cache; 2 | 3 | import androidx.room.Dao; 4 | import androidx.room.Delete; 5 | import androidx.room.Insert; 6 | import androidx.room.OnConflictStrategy; 7 | import androidx.room.Query; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author pj567 13 | * @date :2021/1/7 14 | * @description: 15 | */ 16 | @Dao 17 | public interface VodCollectDao { 18 | @Insert(onConflict = OnConflictStrategy.REPLACE) 19 | long insert(VodCollect record); 20 | 21 | @Query("select * from vodCollect order by updateTime desc") 22 | List getAll(); 23 | 24 | @Query("select * from vodCollect where `id`=:id") 25 | VodCollect getVodCollect(int id); 26 | 27 | @Query("delete from vodCollect where `id`=:id") 28 | void delete(int id); 29 | 30 | @Query("select * from vodCollect where `sourceKey`=:sourceKey and `vodId`=:vodId") 31 | VodCollect getVodCollect(String sourceKey, String vodId); 32 | 33 | @Delete 34 | int delete(VodCollect record); 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/cache/VodRecord.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.cache; 2 | 3 | import androidx.room.ColumnInfo; 4 | import androidx.room.Entity; 5 | import androidx.room.PrimaryKey; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | * @author pj567 11 | * @date :2021/1/7 12 | * @description: 13 | */ 14 | @Entity(tableName = "vodRecord") 15 | public class VodRecord implements Serializable { 16 | @PrimaryKey(autoGenerate = true) 17 | private int id; 18 | @ColumnInfo(name = "vodId") 19 | public String vodId; 20 | @ColumnInfo(name = "updateTime") 21 | public long updateTime; 22 | @ColumnInfo(name = "sourceKey") 23 | public String sourceKey; 24 | public String dataJson; 25 | 26 | public int getId() { 27 | return id; 28 | } 29 | 30 | public void setId(int id) { 31 | this.id = id; 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/cache/VodRecordDao.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.cache; 2 | 3 | import androidx.room.Dao; 4 | import androidx.room.Delete; 5 | import androidx.room.Insert; 6 | import androidx.room.OnConflictStrategy; 7 | import androidx.room.Query; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author pj567 13 | * @date :2021/1/7 14 | * @description: 15 | */ 16 | @Dao 17 | public interface VodRecordDao { 18 | @Insert(onConflict = OnConflictStrategy.REPLACE) 19 | long insert(VodRecord record); 20 | 21 | @Query("select * from vodRecord order by updateTime desc limit :size") 22 | List getAll(int size); 23 | 24 | @Query("select * from vodRecord where `sourceKey`=:sourceKey and `vodId`=:vodId") 25 | VodRecord getVodRecord(String sourceKey, String vodId); 26 | 27 | @Delete 28 | int delete(VodRecord record); 29 | 30 | @Query("select count(*) from vodRecord") 31 | int getCount(); 32 | 33 | /** 34 | * 保留最新指定条数, 其他删除. 35 | * @param size 保留条数 36 | * @return 37 | */ 38 | @Query("DELETE FROM vodRecord where id NOT IN (SELECT id FROM vodRecord ORDER BY updateTime desc LIMIT :size)") 39 | int reserver(int size); 40 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/callback/EmptyCallback.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.callback; 2 | 3 | import com.github.tvbox.osc.R; 4 | import com.kingja.loadsir.callback.Callback; 5 | 6 | /** 7 | * @author pj567 8 | * @date :2020/12/24 9 | * @description: 10 | */ 11 | public class EmptyCallback extends Callback { 12 | @Override 13 | protected int onCreateView() { 14 | return R.layout.loadsir_empty_layout; 15 | } 16 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/callback/LoadingCallback.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.callback; 2 | 3 | import com.github.tvbox.osc.R; 4 | import com.kingja.loadsir.callback.Callback; 5 | 6 | /** 7 | * @author pj567 8 | * @date :2020/12/24 9 | * @description: 10 | */ 11 | public class LoadingCallback extends Callback { 12 | @Override 13 | protected int onCreateView() { 14 | return R.layout.loadsir_loading_layout; 15 | } 16 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/data/AppDataBase.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.data; 2 | 3 | import androidx.room.Database; 4 | import androidx.room.RoomDatabase; 5 | 6 | import com.github.tvbox.osc.cache.Cache; 7 | import com.github.tvbox.osc.cache.CacheDao; 8 | import com.github.tvbox.osc.cache.VodCollect; 9 | import com.github.tvbox.osc.cache.VodCollectDao; 10 | import com.github.tvbox.osc.cache.VodRecord; 11 | import com.github.tvbox.osc.cache.VodRecordDao; 12 | 13 | 14 | /** 15 | * 类描述: 16 | * 17 | * @author pj567 18 | * @since 2020/5/15 19 | */ 20 | @Database(entities = {Cache.class, VodRecord.class, VodCollect.class}, version = 1) 21 | public abstract class AppDataBase extends RoomDatabase { 22 | public abstract CacheDao getCacheDao(); 23 | 24 | public abstract VodRecordDao getVodRecordDao(); 25 | 26 | public abstract VodCollectDao getVodCollectDao(); 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/event/HistoryStateEvent.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.event; 2 | 3 | /** 4 | * @author pj567 5 | * @date :2020/12/21 6 | * @description: 7 | */ 8 | public class HistoryStateEvent { 9 | public final static int TYPE_TOP = 0; 10 | public int type; 11 | 12 | public HistoryStateEvent(int type) { 13 | this.type = type; 14 | } 15 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/event/RefreshEvent.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.event; 2 | 3 | /** 4 | * @author pj567 5 | * @date :2021/1/6 6 | * @description: 7 | */ 8 | public class RefreshEvent { 9 | public static final int TYPE_REFRESH = 0; 10 | public static final int TYPE_HISTORY_REFRESH = 1; 11 | public static final int TYPE_QUICK_SEARCH = 2; 12 | public static final int TYPE_QUICK_SEARCH_SELECT = 3; 13 | public static final int TYPE_QUICK_SEARCH_WORD = 4; 14 | public static final int TYPE_QUICK_SEARCH_WORD_CHANGE = 5; 15 | public static final int TYPE_SEARCH_RESULT = 6; 16 | public static final int TYPE_QUICK_SEARCH_RESULT = 7; 17 | public static final int TYPE_API_URL_CHANGE = 8; 18 | public static final int TYPE_PUSH_URL = 9; 19 | public static final int TYPE_EPG_URL_CHANGE = 10; 20 | public static final int TYPE_SETTING_SEARCH_TV = 11; 21 | public static final int TYPE_SUBTITLE_SIZE_CHANGE = 12; 22 | public static final int TYPE_FILTER_CHANGE = 13; 23 | 24 | public static final int RE_LOAD_HOME_DATA = 25;//重新加载首页数据 25 | public static final int ALI_TOKEN = 26;//接收到阿里token 26 | public int type; 27 | public Object obj; 28 | 29 | public RefreshEvent(int type) { 30 | this.type = type; 31 | } 32 | 33 | public RefreshEvent(int type, Object obj) { 34 | this.type = type; 35 | this.obj = obj; 36 | } 37 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/event/ServerEvent.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.event; 2 | 3 | /** 4 | * @author pj567 5 | * @date :2021/1/5 6 | * @description: 7 | */ 8 | public class ServerEvent { 9 | public static final int SERVER_SUCCESS = 0; 10 | public static final int SERVER_CONNECTION = 1; 11 | public static final int SERVER_SEARCH = 2; 12 | public int type; 13 | public Object obj; 14 | 15 | public ServerEvent(int type) { 16 | this.type = type; 17 | } 18 | 19 | public ServerEvent(int type, Object obj) { 20 | this.type = type; 21 | this.obj = obj; 22 | } 23 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/event/TopStateEvent.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.event; 2 | 3 | /** 4 | * @author pj567 5 | * @date :2020/12/21 6 | * @description: 7 | */ 8 | public class TopStateEvent { 9 | public final static int TYPE_TOP = 0; 10 | public int type; 11 | 12 | public TopStateEvent(int type) { 13 | this.type = type; 14 | } 15 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/player/MyVideoView.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.player; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | 6 | import androidx.annotation.NonNull; 7 | import androidx.annotation.Nullable; 8 | 9 | import xyz.doikki.videoplayer.player.AbstractPlayer; 10 | import xyz.doikki.videoplayer.player.VideoView; 11 | 12 | public class MyVideoView extends VideoView { 13 | public MyVideoView(@NonNull Context context) { 14 | super(context, null); 15 | } 16 | 17 | public MyVideoView(@NonNull Context context, @Nullable AttributeSet attrs) { 18 | super(context, attrs, 0); 19 | } 20 | 21 | public MyVideoView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 22 | super(context, attrs, defStyleAttr); 23 | } 24 | 25 | public AbstractPlayer getMediaPlayer() { 26 | return mMediaPlayer; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/player/TrackInfo.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.player; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class TrackInfo { 7 | private List audio; 8 | private List subtitle; 9 | 10 | public TrackInfo() { 11 | audio = new ArrayList<>(); 12 | subtitle = new ArrayList<>(); 13 | } 14 | 15 | public List getAudio() { 16 | return audio; 17 | } 18 | 19 | public int getAudioSelected(boolean track) { 20 | return getSelected(audio, track); 21 | } 22 | 23 | public int getSubtitleSelected(boolean track) { 24 | return getSelected(subtitle, track); 25 | } 26 | 27 | public int getSelected(List list, boolean track) { 28 | int i = 0; 29 | for (TrackInfoBean trackInfoBean : list) { 30 | if (trackInfoBean.selected) return track ? trackInfoBean.index : i; 31 | i++; 32 | } 33 | return 99999; 34 | } 35 | 36 | public void addAudio(TrackInfoBean audio) { 37 | this.audio.add(audio); 38 | } 39 | 40 | public List getSubtitle() { 41 | return subtitle; 42 | } 43 | 44 | public void addSubtitle(TrackInfoBean subtitle) { 45 | this.subtitle.add(subtitle); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/player/TrackInfoBean.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.player; 2 | 3 | public class TrackInfoBean { 4 | public String name; 5 | public String language; 6 | public int index; 7 | public boolean selected; 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/player/render/SurfaceRenderViewFactory.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.player.render; 2 | 3 | import android.content.Context; 4 | 5 | import xyz.doikki.videoplayer.render.IRenderView; 6 | import xyz.doikki.videoplayer.render.RenderViewFactory; 7 | 8 | public class SurfaceRenderViewFactory extends RenderViewFactory { 9 | 10 | public static SurfaceRenderViewFactory create() { 11 | return new SurfaceRenderViewFactory(); 12 | } 13 | 14 | @Override 15 | public IRenderView createRenderView(Context context) { 16 | return new SurfaceRenderView(context); 17 | } 18 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/receiver/CustomWebReceiver.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.receiver; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | /** 11 | * @author pj567 12 | * @date :2021/1/5 13 | * @description: 14 | */ 15 | public class CustomWebReceiver extends BroadcastReceiver { 16 | public static String action = "android.content.movie.custom.web.Action"; 17 | 18 | public static String REFRESH_SOURCE = "source"; 19 | public static String REFRESH_LIVE = "live"; 20 | public static String REFRESH_PARSE = "parse"; 21 | 22 | public static List callback = new ArrayList<>(); 23 | 24 | public interface Callback { 25 | void onChange(String action, Object obj); 26 | } 27 | 28 | @Override 29 | public void onReceive(Context context, Intent intent) { 30 | if (action.equals(intent.getAction()) && intent.getExtras() != null) { 31 | Object refreshObj = null; 32 | String action = intent.getExtras().getString("action"); 33 | if (action.equals(REFRESH_PARSE)) { 34 | /*String name = intent.getExtras().getString("name"); 35 | String url = intent.getExtras().getString("url");*/ 36 | return; 37 | } else if (action.equals(REFRESH_LIVE)) { 38 | return; 39 | } else { 40 | return; 41 | } 42 | /*if (callback != null) { 43 | for (Callback call : callback) { 44 | call.onChange(action, refreshObj); 45 | } 46 | }*/ 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/receiver/SearchReceiver.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.receiver; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | 7 | import com.github.tvbox.osc.event.ServerEvent; 8 | import com.github.tvbox.osc.ui.activity.SearchActivity; 9 | import com.github.tvbox.osc.util.AppManager; 10 | 11 | import org.greenrobot.eventbus.EventBus; 12 | 13 | /** 14 | * @author pj567 15 | * @date :2021/1/5 16 | * @description: 17 | */ 18 | public class SearchReceiver extends BroadcastReceiver { 19 | public static String action = "android.content.movie.search.Action"; 20 | 21 | @Override 22 | public void onReceive(Context context, Intent intent) { 23 | if (action.equals(intent.getAction()) && intent.getExtras() != null) { 24 | if (AppManager.getInstance().getActivity(SearchActivity.class) != null) { 25 | AppManager.getInstance().backActivity(SearchActivity.class); 26 | EventBus.getDefault().post(new ServerEvent(ServerEvent.SERVER_SEARCH, intent.getExtras().getString("title"))); 27 | } else { 28 | Intent newIntent = new Intent(context, SearchActivity.class); 29 | newIntent.putExtra("title", intent.getExtras().getString("title")); 30 | newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); 31 | context.startActivity(newIntent); 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/server/DataReceiver.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.server; 2 | 3 | /** 4 | * @author pj567 5 | * @date :2021/1/5 6 | * @description: 7 | */ 8 | public interface DataReceiver { 9 | 10 | /** 11 | * @param text 12 | */ 13 | void onTextReceived(String text); 14 | 15 | 16 | void onApiReceived(String url); 17 | 18 | void onPushReceived(String url); 19 | 20 | void onTokenReceived(String token); 21 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/server/RawRequestProcess.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.server; 2 | 3 | import android.content.Context; 4 | 5 | import java.io.IOException; 6 | import java.io.InputStream; 7 | import java.util.Map; 8 | 9 | import fi.iki.elonen.NanoHTTPD; 10 | 11 | /** 12 | * @author pj567 13 | * @date :2021/1/5 14 | * @description: 资源文件加载 15 | */ 16 | public class RawRequestProcess implements RequestProcess { 17 | private Context mContext; 18 | private String fileName; 19 | private int resourceId; 20 | private String mimeType; 21 | 22 | public RawRequestProcess(Context context, String fileName, int resourceId, String mimeType) { 23 | this.mContext = context; 24 | this.fileName = fileName; 25 | this.resourceId = resourceId; 26 | this.mimeType = mimeType; 27 | } 28 | 29 | @Override 30 | public boolean isRequest(NanoHTTPD.IHTTPSession session, String fileName) { 31 | return session.getMethod() == NanoHTTPD.Method.GET && this.fileName.equalsIgnoreCase(fileName); 32 | } 33 | 34 | @Override 35 | public NanoHTTPD.Response doResponse(NanoHTTPD.IHTTPSession session, String fileName, Map params, Map files) { 36 | InputStream inputStream = mContext.getResources().openRawResource(this.resourceId); 37 | try { 38 | return RemoteServer.newFixedLengthResponse(NanoHTTPD.Response.Status.OK, mimeType + "; charset=utf-8", inputStream, (long) inputStream.available()); 39 | } catch (IOException IOExc) { 40 | return RemoteServer.createPlainTextResponse(NanoHTTPD.Response.Status.INTERNAL_ERROR, "SERVER INTERNAL ERROR: IOException: " + IOExc.getMessage()); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/server/RequestProcess.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.server; 2 | 3 | import java.util.Map; 4 | 5 | import fi.iki.elonen.NanoHTTPD; 6 | 7 | /** 8 | * @author pj567 9 | * @date :2021/1/5 10 | * @description: 11 | */ 12 | public interface RequestProcess { 13 | public static final int KEY_ACTION_PRESSED = 0; 14 | public static final int KEY_ACTION_DOWN = 1; 15 | public static final int KEY_ACTION_UP = 2; 16 | 17 | /** 18 | * isRequest 19 | * 20 | * @param session 21 | * @param fileName 22 | * @return 23 | */ 24 | boolean isRequest(NanoHTTPD.IHTTPSession session, String fileName); 25 | 26 | /** 27 | * doResponse 28 | * 29 | * @param session 30 | * @param fileName 31 | * @param params 32 | * @param files 33 | * @return 34 | */ 35 | NanoHTTPD.Response doResponse(NanoHTTPD.IHTTPSession session, String fileName, Map params, Map files); 36 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/subtitle/SubtitleLoadSuccessResult.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.subtitle; 2 | 3 | import com.github.tvbox.osc.subtitle.model.TimedTextObject; 4 | 5 | public class SubtitleLoadSuccessResult { 6 | public String fileName; 7 | public String content; 8 | public TimedTextObject timedTextObject; 9 | public String subtitlePath; 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/subtitle/model/Region.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Class that represents the .ASS and .SSA subtitle file format 3 | * 4 | *

5 | * Copyright (c) 2012 J. David Requejo
6 | * j[dot]david[dot]requejo[at] Gmail 7 | *

8 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 9 | * and associated documentation files (the "Software"), to deal in the Software without restriction, 10 | * including without limitation the rights to use, copy, modify, merge, publish, distribute, 11 | * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software 12 | * is furnished to do so, subject to the following conditions: 13 | *

14 | * The above copyright notice and this permission notice shall be included in all copies 15 | * or substantial portions of the Software. 16 | *

17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 18 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 19 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 20 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 21 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22 | * DEALINGS IN THE SOFTWARE. 23 | * 24 | * @author J. David REQUEJO 25 | * 26 | */ 27 | 28 | package com.github.tvbox.osc.subtitle.model; 29 | 30 | public class Region { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/subtitle/model/Subtitle.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Class that represents the .ASS and .SSA subtitle file format 3 | * 4 | *

5 | * Copyright (c) 2012 J. David Requejo
6 | * j[dot]david[dot]requejo[at] Gmail 7 | *

8 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 9 | * and associated documentation files (the "Software"), to deal in the Software without restriction, 10 | * including without limitation the rights to use, copy, modify, merge, publish, distribute, 11 | * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software 12 | * is furnished to do so, subject to the following conditions: 13 | *

14 | * The above copyright notice and this permission notice shall be included in all copies 15 | * or substantial portions of the Software. 16 | *

17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 18 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 19 | * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 20 | * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 21 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22 | * DEALINGS IN THE SOFTWARE. 23 | * 24 | * @author J. David REQUEJO 25 | * 26 | */ 27 | 28 | package com.github.tvbox.osc.subtitle.model; 29 | 30 | public class Subtitle { 31 | 32 | public Style style; 33 | public Region region; 34 | 35 | public Time start; 36 | public Time end; 37 | 38 | public String content=""; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/subtitle/runtime/TaskExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) of Avery 3 | * 4 | * _ooOoo_ 5 | * o8888888o 6 | * 88" . "88 7 | * (| -_- |) 8 | * O\ = /O 9 | * ____/`- -'\____ 10 | * .' \\| |// `. 11 | * / \\||| : |||// \ 12 | * / _||||| -:- |||||- \ 13 | * | | \\\ - /// | | 14 | * | \_| ''\- -/'' | | 15 | * \ .-\__ `-` ___/-. / 16 | * ___`. .' /- -.- -\ `. . __ 17 | * ."" '< `.___\_<|>_/___.' >'"". 18 | * | | : `- \`.;`\ _ /`;.`/ - ` : | | 19 | * \ \ `-. \_ __\ /__ _/ .-` / / 20 | * ======`-.____`-.___\_____/___.-`____.-'====== 21 | * `=- -=' 22 | * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 23 | * Buddha bless, there will never be bug!!! 24 | */ 25 | 26 | package com.github.tvbox.osc.subtitle.runtime; 27 | 28 | /** 29 | * @author AveryZhong. 30 | */ 31 | 32 | public abstract class TaskExecutor { 33 | 34 | public abstract void executeOnDeskIO(Runnable task); 35 | 36 | public void executeOnMainThread(Runnable task) { 37 | if (isMainThread()) { 38 | task.run(); 39 | } else { 40 | postToMainThread(task); 41 | } 42 | } 43 | 44 | public abstract void postToMainThread(Runnable task); 45 | 46 | public abstract boolean isMainThread(); 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/adapter/BackupAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.adapter; 2 | 3 | import com.chad.library.adapter.base.BaseQuickAdapter; 4 | import com.chad.library.adapter.base.BaseViewHolder; 5 | import com.github.tvbox.osc.R; 6 | 7 | import java.util.ArrayList; 8 | 9 | public class BackupAdapter extends BaseQuickAdapter { 10 | public BackupAdapter() { 11 | super(R.layout.item_dialog_backup, new ArrayList<>()); 12 | } 13 | 14 | @Override 15 | protected void convert(BaseViewHolder helper, String item) { 16 | helper.setText(R.id.tvName, item); 17 | helper.addOnClickListener(R.id.tvName); 18 | } 19 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/adapter/GridFilterKVAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.adapter; 2 | 3 | import com.chad.library.adapter.base.BaseQuickAdapter; 4 | import com.chad.library.adapter.base.BaseViewHolder; 5 | import com.github.tvbox.osc.R; 6 | 7 | import java.util.ArrayList; 8 | 9 | public class GridFilterKVAdapter extends BaseQuickAdapter { 10 | public GridFilterKVAdapter() { 11 | super(R.layout.item_grid_filter_value, new ArrayList<>()); 12 | } 13 | 14 | @Override 15 | protected void convert(BaseViewHolder helper, String item) { 16 | helper.setText(R.id.filterValue, item); 17 | } 18 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/adapter/ParseAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.adapter; 2 | 3 | import android.graphics.Color; 4 | import android.view.View; 5 | import android.widget.TextView; 6 | 7 | import com.chad.library.adapter.base.BaseQuickAdapter; 8 | import com.chad.library.adapter.base.BaseViewHolder; 9 | import com.github.tvbox.osc.R; 10 | import com.github.tvbox.osc.bean.ParseBean; 11 | 12 | import java.util.ArrayList; 13 | 14 | public class ParseAdapter extends BaseQuickAdapter { 15 | public ParseAdapter() { 16 | super(R.layout.item_play_parse, new ArrayList<>()); 17 | } 18 | 19 | @Override 20 | protected void convert(BaseViewHolder helper, ParseBean item) { 21 | TextView tvParse = helper.getView(R.id.tvParse); 22 | tvParse.setVisibility(View.VISIBLE); 23 | if (item.isDefault()) { 24 | tvParse.setTextColor(mContext.getResources().getColor(R.color.color_02F8E1)); 25 | } else { 26 | tvParse.setTextColor(Color.WHITE); 27 | } 28 | tvParse.setText(item.getName()); 29 | } 30 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/adapter/PinyinAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.adapter; 2 | 3 | import com.chad.library.adapter.base.BaseQuickAdapter; 4 | import com.chad.library.adapter.base.BaseViewHolder; 5 | import com.github.tvbox.osc.R; 6 | 7 | import java.util.ArrayList; 8 | 9 | public class PinyinAdapter extends BaseQuickAdapter { 10 | public PinyinAdapter() { 11 | super(R.layout.item_search_word_hot, new ArrayList<>()); 12 | } 13 | 14 | @Override 15 | protected void convert(BaseViewHolder helper, String item) { 16 | helper.setText(R.id.tvSearchWord, item); 17 | } 18 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/adapter/SearchSubtitleAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.adapter; 2 | 3 | import com.chad.library.adapter.base.BaseQuickAdapter; 4 | import com.chad.library.adapter.base.BaseViewHolder; 5 | import com.github.tvbox.osc.R; 6 | import com.github.tvbox.osc.bean.Subtitle; 7 | 8 | import java.util.ArrayList; 9 | 10 | public class SearchSubtitleAdapter extends BaseQuickAdapter { 11 | 12 | public SearchSubtitleAdapter() { 13 | super(R.layout.item_search_subtitle_result, new ArrayList<>()); 14 | } 15 | 16 | @Override 17 | protected void convert(BaseViewHolder helper, Subtitle item) { 18 | helper.setText(R.id.subtitleName, item.getName()); 19 | helper.setText(R.id.subtitleNameInfo, item.getIsZip() ? "压缩包" : "文件"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/adapter/SearchWordAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.adapter; 2 | 3 | import com.chad.library.adapter.base.BaseQuickAdapter; 4 | import com.chad.library.adapter.base.BaseViewHolder; 5 | import com.github.tvbox.osc.R; 6 | 7 | import java.util.ArrayList; 8 | 9 | /** 10 | * @author pj567 11 | * @date :2020/12/23 12 | * @description: 13 | */ 14 | public class SearchWordAdapter extends BaseQuickAdapter { 15 | public SearchWordAdapter() { 16 | super(R.layout.item_search_word_split, new ArrayList<>()); 17 | } 18 | 19 | @Override 20 | protected void convert(BaseViewHolder helper, String item) { 21 | helper.setText(R.id.tvSearchWord, item); 22 | } 23 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/adapter/SeriesAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.adapter; 2 | 3 | import android.graphics.Color; 4 | import android.widget.TextView; 5 | 6 | import com.chad.library.adapter.base.BaseQuickAdapter; 7 | import com.chad.library.adapter.base.BaseViewHolder; 8 | import com.github.tvbox.osc.R; 9 | import com.github.tvbox.osc.bean.VodInfo; 10 | 11 | import java.util.ArrayList; 12 | 13 | /** 14 | * @author pj567 15 | * @date :2020/12/22 16 | * @description: 17 | */ 18 | public class SeriesAdapter extends BaseQuickAdapter { 19 | public SeriesAdapter() { 20 | super(R.layout.item_series, new ArrayList<>()); 21 | } 22 | 23 | @Override 24 | protected void convert(BaseViewHolder helper, VodInfo.VodSeries item) { 25 | TextView tvSeries = helper.getView(R.id.tvSeries); 26 | if (item.selected) { 27 | tvSeries.setTextColor(mContext.getResources().getColor(R.color.color_02F8E1)); 28 | } else { 29 | tvSeries.setTextColor(Color.WHITE); 30 | } 31 | helper.setText(R.id.tvSeries, item.name); 32 | } 33 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/adapter/SeriesFlagAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.adapter; 2 | 3 | import android.view.View; 4 | import android.widget.TextView; 5 | 6 | import com.chad.library.adapter.base.BaseQuickAdapter; 7 | import com.chad.library.adapter.base.BaseViewHolder; 8 | import com.github.tvbox.osc.R; 9 | import com.github.tvbox.osc.bean.VodInfo; 10 | 11 | import java.util.ArrayList; 12 | 13 | /** 14 | * @author pj567 15 | * @date :2020/12/22 16 | * @description: 17 | */ 18 | public class SeriesFlagAdapter extends BaseQuickAdapter { 19 | public SeriesFlagAdapter() { 20 | super(R.layout.item_series_flag, new ArrayList<>()); 21 | } 22 | 23 | @Override 24 | protected void convert(BaseViewHolder helper, VodInfo.VodSeriesFlag item) { 25 | TextView tvSeries = helper.getView(R.id.tvSeriesFlag); 26 | View select = helper.getView(R.id.tvSeriesFlagSelect); 27 | if (item.selected) { 28 | select.setVisibility(View.VISIBLE); 29 | } else { 30 | select.setVisibility(View.GONE); 31 | } 32 | helper.setText(R.id.tvSeriesFlag, item.name); 33 | } 34 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/adapter/SettingMenuAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.adapter; 2 | 3 | import com.chad.library.adapter.base.BaseQuickAdapter; 4 | import com.chad.library.adapter.base.BaseViewHolder; 5 | import com.github.tvbox.osc.R; 6 | 7 | import java.util.ArrayList; 8 | 9 | /** 10 | * @author pj567 11 | * @date :2020/12/23 12 | * @description: 13 | */ 14 | public class SettingMenuAdapter extends BaseQuickAdapter { 15 | public SettingMenuAdapter() { 16 | super(R.layout.item_setting_menu, new ArrayList<>()); 17 | } 18 | 19 | @Override 20 | protected void convert(BaseViewHolder helper, String item) { 21 | helper.setText(R.id.tvName, item); 22 | helper.addOnClickListener(R.id.tvName); 23 | } 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/adapter/SettingPageAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.adapter; 2 | 3 | import android.view.ViewGroup; 4 | 5 | import androidx.fragment.app.Fragment; 6 | import androidx.fragment.app.FragmentManager; 7 | import androidx.fragment.app.FragmentPagerAdapter; 8 | 9 | import com.github.tvbox.osc.base.BaseLazyFragment; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * @user acer 15 | * @date 2018/12/4 16 | */ 17 | 18 | public class SettingPageAdapter extends FragmentPagerAdapter { 19 | public FragmentManager fragmentManager; 20 | public List list; 21 | 22 | public SettingPageAdapter(FragmentManager fm) { 23 | super(fm); 24 | } 25 | 26 | public SettingPageAdapter(FragmentManager fm, List list) { 27 | super(fm); 28 | this.fragmentManager = fm; 29 | this.list = list; 30 | } 31 | 32 | @Override 33 | public Fragment getItem(int position) { 34 | return list.get(position); 35 | } 36 | 37 | @Override 38 | public int getCount() { 39 | return list != null ? list.size() : 0; 40 | } 41 | 42 | @Override 43 | public Fragment instantiateItem(ViewGroup container, int position) { 44 | Fragment fragment = (Fragment) super.instantiateItem(container, position); 45 | fragmentManager.beginTransaction().show(fragment).commitAllowingStateLoss(); 46 | return fragment; 47 | } 48 | 49 | @Override 50 | public void destroyItem(ViewGroup container, int position, Object object) { 51 | // super.destroyItem(container, position, object); 52 | Fragment fragment = list.get(position); 53 | fragmentManager.beginTransaction().hide(fragment).commitAllowingStateLoss(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/adapter/SortAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.adapter; 2 | 3 | import com.chad.library.adapter.base.BaseQuickAdapter; 4 | import com.chad.library.adapter.base.BaseViewHolder; 5 | import com.github.tvbox.osc.R; 6 | import com.github.tvbox.osc.bean.MovieSort; 7 | 8 | import java.util.ArrayList; 9 | 10 | /** 11 | * @author pj567 12 | * @date :2020/12/21 13 | * @description: 14 | */ 15 | public class SortAdapter extends BaseQuickAdapter { 16 | public SortAdapter() { 17 | super(R.layout.item_home_sort, new ArrayList<>()); 18 | } 19 | 20 | @Override 21 | protected void convert(BaseViewHolder helper, MovieSort.SortData item) { 22 | helper.setText(R.id.tvTitle, item.name); 23 | } 24 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/dialog/AboutDialog.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.dialog; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.annotation.NonNull; 6 | 7 | import com.github.tvbox.osc.R; 8 | 9 | import org.jetbrains.annotations.NotNull; 10 | 11 | public class AboutDialog extends BaseDialog { 12 | 13 | public AboutDialog(@NonNull @NotNull Context context) { 14 | super(context); 15 | setContentView(R.layout.dialog_about); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/dialog/ApiHistoryDialog.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.dialog; 2 | 3 | import android.content.Context; 4 | import android.os.Bundle; 5 | import android.widget.TextView; 6 | 7 | import androidx.annotation.NonNull; 8 | 9 | import com.github.tvbox.osc.R; 10 | import com.github.tvbox.osc.ui.adapter.ApiHistoryDialogAdapter; 11 | import com.owen.tvrecyclerview.widget.TvRecyclerView; 12 | 13 | import org.jetbrains.annotations.NotNull; 14 | 15 | import java.util.List; 16 | 17 | public class ApiHistoryDialog extends BaseDialog { 18 | public ApiHistoryDialog(@NonNull @NotNull Context context) { 19 | super(context, R.style.CustomDialogStyleDim); 20 | setContentView(R.layout.dialog_api_history); 21 | } 22 | 23 | @Override 24 | protected void onCreate(Bundle savedInstanceState) { 25 | super.onCreate(savedInstanceState); 26 | } 27 | 28 | public void setTip(String tip) { 29 | ((TextView) findViewById(R.id.title)).setText(tip); 30 | } 31 | 32 | public void setAdapter(ApiHistoryDialogAdapter.SelectDialogInterface sourceBeanSelectDialogInterface, List data, int select) { 33 | ApiHistoryDialogAdapter adapter = new ApiHistoryDialogAdapter(sourceBeanSelectDialogInterface); 34 | adapter.setData(data, select); 35 | TvRecyclerView tvRecyclerView = ((TvRecyclerView) findViewById(R.id.list)); 36 | tvRecyclerView.setAdapter(adapter); 37 | tvRecyclerView.setSelectedPosition(select); 38 | tvRecyclerView.post(new Runnable() { 39 | @Override 40 | public void run() { 41 | tvRecyclerView.scrollToPosition(select); 42 | } 43 | }); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/dialog/LivePasswordDialog.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.dialog; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.os.Handler; 6 | import android.os.Looper; 7 | import android.os.Message; 8 | import android.view.View; 9 | import android.widget.EditText; 10 | 11 | import androidx.annotation.NonNull; 12 | 13 | import com.github.tvbox.osc.R; 14 | 15 | import org.jetbrains.annotations.NotNull; 16 | 17 | 18 | 19 | /** 20 | * 描述 21 | * 22 | * @author pj567 23 | * @since 2020/12/27 24 | */ 25 | public class LivePasswordDialog extends BaseDialog { 26 | private EditText inputPassword; 27 | 28 | public LivePasswordDialog(@NonNull @NotNull Context context) { 29 | super(context); 30 | setOwnerActivity((Activity) context); 31 | setContentView(R.layout.dialog_live_password); 32 | inputPassword = findViewById(R.id.input); 33 | findViewById(R.id.inputSubmit).setOnClickListener(new View.OnClickListener() { 34 | @Override 35 | public void onClick(View v) { 36 | String password = inputPassword.getText().toString().trim(); 37 | if (!password.isEmpty()) { 38 | listener.onChange(password); 39 | dismiss(); 40 | } 41 | } 42 | }); 43 | } 44 | 45 | @Override 46 | public void onBackPressed() { 47 | super.onBackPressed(); 48 | listener.onCancel(); 49 | dismiss(); 50 | } 51 | 52 | public void setOnListener(OnListener listener) { 53 | this.listener = listener; 54 | } 55 | 56 | OnListener listener = null; 57 | 58 | public interface OnListener { 59 | void onChange(String password); 60 | void onCancel(); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/dialog/RemoteDialog.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.dialog; 2 | 3 | import android.content.Context; 4 | import android.widget.ImageView; 5 | import android.widget.TextView; 6 | 7 | import androidx.annotation.NonNull; 8 | 9 | import com.github.tvbox.osc.R; 10 | import com.github.tvbox.osc.server.ControlManager; 11 | import com.github.tvbox.osc.ui.tv.QRCodeGen; 12 | 13 | import org.jetbrains.annotations.NotNull; 14 | 15 | import me.jessyan.autosize.utils.AutoSizeUtils; 16 | 17 | public class RemoteDialog extends BaseDialog { 18 | private ImageView ivQRCode; 19 | private TextView tvAddress; 20 | 21 | public RemoteDialog(@NonNull @NotNull Context context) { 22 | super(context); 23 | setContentView(R.layout.dialog_remote); 24 | setCanceledOnTouchOutside(false); 25 | ivQRCode = findViewById(R.id.ivQRCode); 26 | tvAddress = findViewById(R.id.tvAddress); 27 | refreshQRCode(); 28 | } 29 | 30 | private void refreshQRCode() { 31 | String address = ControlManager.get().getAddress(false); 32 | tvAddress.setText(String.format("手机/电脑扫描上方二维码或者直接浏览器访问地址\n%s", address)); 33 | ivQRCode.setImageBitmap(QRCodeGen.generateBitmap(address, AutoSizeUtils.mm2px(getContext(), 240), AutoSizeUtils.mm2px(getContext(), 240))); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/dialog/TipDialog.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.dialog; 2 | 3 | import android.content.Context; 4 | import android.content.DialogInterface; 5 | import android.view.View; 6 | import android.widget.TextView; 7 | 8 | import androidx.annotation.NonNull; 9 | 10 | import com.github.tvbox.osc.R; 11 | 12 | import org.jetbrains.annotations.NotNull; 13 | 14 | public class TipDialog extends BaseDialog { 15 | 16 | public TipDialog(@NonNull @NotNull Context context, String tip, String left, String right, OnListener listener) { 17 | super(context); 18 | setContentView(R.layout.dialog_tip); 19 | setCanceledOnTouchOutside(false); 20 | TextView tipInfo = findViewById(R.id.tipInfo); 21 | TextView leftBtn = findViewById(R.id.leftBtn); 22 | TextView rightBtn = findViewById(R.id.rightBtn); 23 | tipInfo.setText(tip); 24 | leftBtn.setText(left); 25 | rightBtn.setText(right); 26 | leftBtn.setOnClickListener(new View.OnClickListener() { 27 | @Override 28 | public void onClick(View v) { 29 | listener.left(); 30 | } 31 | }); 32 | rightBtn.setOnClickListener(new View.OnClickListener() { 33 | @Override 34 | public void onClick(View v) { 35 | listener.right(); 36 | } 37 | }); 38 | setOnCancelListener(new OnCancelListener() { 39 | @Override 40 | public void onCancel(DialogInterface dialog) { 41 | listener.cancel(); 42 | } 43 | }); 44 | } 45 | 46 | public interface OnListener { 47 | void left(); 48 | 49 | void right(); 50 | 51 | void cancel(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/tv/QRCodeGen.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.tv; 2 | 3 | import android.graphics.Bitmap; 4 | 5 | import com.google.zxing.BarcodeFormat; 6 | import com.google.zxing.EncodeHintType; 7 | import com.google.zxing.WriterException; 8 | import com.google.zxing.common.BitMatrix; 9 | import com.google.zxing.qrcode.QRCodeWriter; 10 | 11 | import java.util.HashMap; 12 | import java.util.Map; 13 | 14 | /** 15 | * @author pj567 16 | * @date :2021/1/5 17 | * @description: 18 | */ 19 | public class QRCodeGen { 20 | public static Bitmap generateBitmap(String content, int width, int height, int padding) { 21 | QRCodeWriter qrCodeWriter = new QRCodeWriter(); 22 | Map hints = new HashMap<>(); 23 | hints.put(EncodeHintType.CHARACTER_SET, "utf-8"); 24 | hints.put(EncodeHintType.MARGIN, padding + ""); 25 | try { 26 | BitMatrix encode = qrCodeWriter.encode(content, BarcodeFormat.QR_CODE, width, height, hints); 27 | int[] pixels = new int[width * height]; 28 | for (int i = 0; i < height; i++) { 29 | for (int j = 0; j < width; j++) { 30 | if (encode.get(j, i)) { 31 | pixels[i * width + j] = 0x00000000; 32 | } else { 33 | pixels[i * width + j] = 0xffffffff; 34 | } 35 | } 36 | } 37 | return Bitmap.createBitmap(pixels, 0, width, width, height, Bitmap.Config.RGB_565); 38 | } catch (WriterException e) { 39 | e.printStackTrace(); 40 | } 41 | return null; 42 | } 43 | 44 | public static Bitmap generateBitmap(String content, int width, int height) { 45 | return generateBitmap(content, width, height, 0); 46 | } 47 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/tv/widget/ChannelListView.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.tv.widget; 2 | 3 | 4 | 5 | import android.content.Context; 6 | import android.graphics.Rect; 7 | import android.util.AttributeSet; 8 | import android.widget.ListView; 9 | 10 | import com.github.tvbox.osc.ui.activity.LivePlayActivity; 11 | 12 | public class ChannelListView extends ListView { 13 | DataChangedListener dataChangedListener; 14 | public int pos= LivePlayActivity.currentChannelGroupIndex; 15 | private int y; 16 | 17 | public ChannelListView(Context context) { 18 | super(context); 19 | } 20 | public ChannelListView(Context context, AttributeSet attrs) { 21 | super(context, attrs); 22 | } 23 | public ChannelListView(Context context, AttributeSet attrs, int defStyleAttr) { 24 | super(context, attrs, defStyleAttr); 25 | } 26 | public void setSelect(int position,int y) { 27 | super.setSelection(position); 28 | pos=position; 29 | this.y=y; 30 | } 31 | @Override 32 | protected void onFocusChanged(boolean gainFocus, int direction, 33 | Rect previouslyFocusedRect) { 34 | super.onFocusChanged(gainFocus, direction, previouslyFocusedRect); 35 | if (gainFocus) { 36 | setSelectionFromTop(pos, y); 37 | } 38 | } 39 | 40 | 41 | @Override 42 | protected void handleDataChanged() { 43 | super.handleDataChanged(); 44 | if(dataChangedListener!=null)dataChangedListener.onSuccess(); 45 | } 46 | public void setDataChangedListener(DataChangedListener dataChangedListener) { 47 | this.dataChangedListener = dataChangedListener; 48 | } 49 | public interface DataChangedListener{ 50 | public void onSuccess(); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/tv/widget/DefaultTransformer.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.tv.widget; 2 | 3 | import android.view.View; 4 | 5 | import androidx.viewpager.widget.ViewPager; 6 | 7 | /** 8 | * @author acer 9 | * @date 2018/8/22 11:46 10 | */ 11 | public class DefaultTransformer implements ViewPager.PageTransformer{ 12 | @Override 13 | public void transformPage(View page, float position) { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/tv/widget/FixedSpeedScroller.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.tv.widget; 2 | 3 | import android.content.Context; 4 | import android.view.animation.Interpolator; 5 | import android.widget.Scroller; 6 | 7 | /** 8 | * 9 | * @author acer 10 | * @date 2018/7/24 11 | */ 12 | 13 | public class FixedSpeedScroller extends Scroller { 14 | private int mDuration = 0; 15 | 16 | public void setmDuration(int mDuration) { 17 | this.mDuration = mDuration; 18 | } 19 | 20 | public FixedSpeedScroller(Context context) { 21 | super(context); 22 | } 23 | 24 | public FixedSpeedScroller(Context context, Interpolator interpolator) { 25 | super(context, interpolator); 26 | } 27 | 28 | public FixedSpeedScroller(Context context, Interpolator interpolator, boolean flywheel) { 29 | super(context, interpolator, flywheel); 30 | } 31 | 32 | 33 | @Override 34 | public void startScroll(int startX, int startY, int dx, int dy, int duration) { 35 | super.startScroll(startX, startY, dx, dy, mDuration); 36 | } 37 | 38 | @Override 39 | public void startScroll(int startX, int startY, int dx, int dy) { 40 | super.startScroll(startX, startY, dx, dy, mDuration); 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/tv/widget/LoadMoreView.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.tv.widget; 2 | 3 | 4 | import com.github.tvbox.osc.R; 5 | 6 | public final class LoadMoreView extends com.chad.library.adapter.base.loadmore.LoadMoreView { 7 | 8 | @Override 9 | public int getLayoutId() { 10 | return R.layout.item_view_load_more; 11 | } 12 | 13 | @Override 14 | protected int getLoadingViewId() { 15 | return R.id.load_more_loading_view; 16 | } 17 | 18 | @Override 19 | protected int getLoadFailViewId() { 20 | return R.id.load_more_load_fail_view; 21 | } 22 | 23 | @Override 24 | protected int getLoadEndViewId() { 25 | return R.id.load_more_load_end_view; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/tv/widget/MarqueeTextView.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.tv.widget; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.content.Context; 5 | import android.text.TextUtils; 6 | import android.util.AttributeSet; 7 | import android.widget.TextView; 8 | 9 | import androidx.annotation.Nullable; 10 | 11 | /** 12 | * Created by acer on 2018/7/13. 13 | */ 14 | 15 | @SuppressLint("AppCompatCustomView") 16 | public class MarqueeTextView extends TextView{ 17 | public MarqueeTextView(Context context) { 18 | this(context, null); 19 | } 20 | 21 | public MarqueeTextView(Context context, @Nullable AttributeSet attrs) { 22 | this(context, attrs, 0); 23 | } 24 | 25 | public MarqueeTextView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { 26 | super(context, attrs, defStyleAttr); 27 | setSelected(true); 28 | setSingleLine(true); 29 | setMarqueeRepeatLimit(-1); 30 | setEllipsize(TextUtils.TruncateAt.MARQUEE); 31 | } 32 | 33 | @Override 34 | public boolean isFocused() { 35 | return true; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/tv/widget/NoScrollViewPager.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.tv.widget; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.view.KeyEvent; 6 | import android.view.MotionEvent; 7 | 8 | import androidx.annotation.NonNull; 9 | import androidx.annotation.Nullable; 10 | import androidx.viewpager.widget.ViewPager; 11 | 12 | /** 13 | * @author acer 14 | * @date 2018/7/24 15 | */ 16 | 17 | public class NoScrollViewPager extends ViewPager { 18 | 19 | public NoScrollViewPager(@NonNull Context context) { 20 | this(context, null); 21 | } 22 | 23 | public NoScrollViewPager(@NonNull Context context, @Nullable AttributeSet attrs) { 24 | super(context, attrs); 25 | } 26 | 27 | /** 28 | * 禁止viewpager里面内容导致页面切换 29 | * 30 | * @param event 31 | * @return 32 | */ 33 | @Override 34 | public boolean executeKeyEvent(KeyEvent event) { 35 | return false; 36 | } 37 | 38 | @Override 39 | public boolean onTouchEvent(MotionEvent ev) { 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/ui/tv/widget/ViewObj.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.ui.tv.widget; 2 | 3 | import android.view.View; 4 | import android.view.ViewGroup; 5 | 6 | /** 7 | * 描述 8 | * 9 | * @author pj567 10 | * @since 2020/7/28 11 | */ 12 | public class ViewObj { 13 | private final View view; 14 | private final ViewGroup.MarginLayoutParams params; 15 | 16 | public ViewObj(View view, ViewGroup.MarginLayoutParams params) { 17 | this.view = view; 18 | this.params = params; 19 | } 20 | 21 | public void setMarginLeft(int left) { 22 | params.leftMargin = left; 23 | view.setLayoutParams(params); 24 | } 25 | 26 | public void setMarginTop(int top) { 27 | params.topMargin = top; 28 | view.setLayoutParams(params); 29 | } 30 | 31 | public void setMarginRight(int right) { 32 | params.rightMargin = right; 33 | view.setLayoutParams(params); 34 | } 35 | 36 | public void setMarginBottom(int bottom) { 37 | params.bottomMargin = bottom; 38 | view.setLayoutParams(params); 39 | } 40 | 41 | public void setWidth(int width) { 42 | params.width = width; 43 | view.setLayoutParams(params); 44 | } 45 | 46 | public void setHeight(int height) { 47 | params.height = height; 48 | view.setLayoutParams(params); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/util/AdBlocker.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.util; 2 | 3 | import android.webkit.WebResourceResponse; 4 | 5 | import java.io.ByteArrayInputStream; 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | public class AdBlocker { 10 | private static final List AD_HOSTS = new ArrayList<>(); 11 | 12 | public static void clear() { 13 | AD_HOSTS.clear(); 14 | } 15 | 16 | public static boolean isEmpty() { 17 | return AD_HOSTS.isEmpty(); 18 | } 19 | 20 | public static void addAdHost(String host) { 21 | AD_HOSTS.add(host); 22 | } 23 | 24 | public static boolean isAd(String url) { 25 | url = url.toLowerCase(); 26 | for (String adHost : AD_HOSTS) { 27 | if (url.contains(adHost)) { 28 | return true; 29 | } 30 | } 31 | return false; 32 | } 33 | 34 | public static WebResourceResponse createEmptyResource() { 35 | return new WebResourceResponse("text/plain", "utf-8", new ByteArrayInputStream("".getBytes())); 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/util/FastClickCheckUtil.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.util; 2 | 3 | import android.os.Handler; 4 | import android.view.View; 5 | 6 | /** 7 | * @author pj567 8 | * @date :2020/12/22 9 | * @description: 10 | */ 11 | public class FastClickCheckUtil { 12 | /** 13 | * 相同视图点击必须间隔0.5s才能有效 14 | * 15 | * @param view 目标视图 16 | */ 17 | public static void check(View view) { 18 | check(view, 500); 19 | } 20 | 21 | /** 22 | * 设置间隔点击规则,配置间隔点击时长 23 | * 24 | * @param view 目标视图 25 | * @param mills 点击间隔时间(毫秒) 26 | */ 27 | public static void check(final View view, int mills) { 28 | view.setClickable(false); 29 | new Handler().postDelayed(new Runnable() { 30 | @Override 31 | public void run() { 32 | view.setClickable(true); 33 | } 34 | }, mills); 35 | } 36 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/util/HistoryHelper.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.util; 2 | 3 | public class HistoryHelper { 4 | private static Integer[] hisNumArray = {30,50,70}; 5 | 6 | public static final String getHistoryNumName(int index){ 7 | Integer value = getHisNum(index); 8 | return value + "条"; 9 | } 10 | 11 | public static final int getHisNum(int index){ 12 | Integer value = null; 13 | if(index>=0 && index < hisNumArray.length){ 14 | value = hisNumArray[index]; 15 | }else{ 16 | value = hisNumArray[0]; 17 | } 18 | return value; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/util/LOG.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.util; 2 | 3 | import android.util.Log; 4 | 5 | /** 6 | * @author pj567 7 | * @date :2020/12/18 8 | * @description: 9 | */ 10 | public class LOG { 11 | private static String TAG = "TVBox"; 12 | 13 | public static void e(String msg) { 14 | Log.e(TAG, "" + msg); 15 | } 16 | 17 | public static void i(String msg) { 18 | Log.i(TAG, "" + msg); 19 | } 20 | } -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/util/ScreenUtils.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.util; 2 | 3 | import android.app.Activity; 4 | import android.util.DisplayMetrics; 5 | import android.view.WindowManager; 6 | 7 | public class ScreenUtils { 8 | 9 | public static double getSqrt(Activity activity) { 10 | WindowManager wm = activity.getWindowManager(); 11 | DisplayMetrics dm = new DisplayMetrics(); 12 | wm.getDefaultDisplay().getMetrics(dm); 13 | double x = Math.pow(dm.widthPixels / dm.xdpi, 2); 14 | double y = Math.pow(dm.heightPixels / dm.ydpi, 2); 15 | double screenInches = Math.sqrt(x + y);// 屏幕尺寸 16 | return screenInches; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/util/SubtitleHelper.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.util; 2 | 3 | import android.app.Activity; 4 | 5 | import com.orhanobut.hawk.Hawk; 6 | 7 | public class SubtitleHelper { 8 | 9 | public static int getSubtitleTextAutoSize(Activity activity) { 10 | double screenSqrt = ScreenUtils.getSqrt(activity); 11 | int subtitleTextSize = 16; 12 | if (screenSqrt > 7.0 && screenSqrt <= 13.0) { 13 | subtitleTextSize = 24; 14 | } else if (screenSqrt > 13.0 && screenSqrt <= 50.0) { 15 | subtitleTextSize = 36; 16 | } else if (screenSqrt > 50.0) { 17 | subtitleTextSize = 46; 18 | } 19 | return subtitleTextSize; 20 | } 21 | 22 | public static int getTextSize(Activity activity) { 23 | int autoSize = getSubtitleTextAutoSize(activity); 24 | int subtitleConfigSize = Hawk.get(HawkConfig.SUBTITLE_TEXT_SIZE, autoSize); 25 | return subtitleConfigSize; 26 | } 27 | 28 | public static void setTextSize(int size) { 29 | Hawk.put(HawkConfig.SUBTITLE_TEXT_SIZE, size); 30 | } 31 | 32 | public static int getTimeDelay() { 33 | int subtitleConfigTimeDelay = Hawk.get(HawkConfig.SUBTITLE_TIME_DELAY, 0); 34 | return subtitleConfigTimeDelay; 35 | } 36 | 37 | public static void setTimeDelay(int delay) { 38 | Hawk.put(HawkConfig.SUBTITLE_TIME_DELAY, delay); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/util/js/UTF8BOMFighter.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.util.js; 2 | 3 | public class UTF8BOMFighter { 4 | private static final byte[] UTF8_BOM_BYTES = new byte[]{(byte) 0xEF, (byte) 0xBB, (byte) 0xBF}; 5 | 6 | private UTF8BOMFighter() { 7 | } 8 | 9 | static public String removeUTF8BOM(String xmlText) { 10 | byte[] bytes = xmlText.getBytes(); 11 | boolean containsBOM = bytes.length > 3 12 | && bytes[0] == UTF8_BOM_BYTES[0] 13 | && bytes[1] == UTF8_BOM_BYTES[1] 14 | && bytes[2] == UTF8_BOM_BYTES[2]; 15 | if (containsBOM) { 16 | xmlText = new String(bytes, 3, bytes.length - 3); 17 | } 18 | return xmlText; 19 | } 20 | 21 | static byte[] removeUTF8BOM(byte[] bytes) { 22 | boolean containsBOM = bytes.length > 3 23 | && bytes[0] == UTF8_BOM_BYTES[0] 24 | && bytes[1] == UTF8_BOM_BYTES[1] 25 | && bytes[2] == UTF8_BOM_BYTES[2]; 26 | if (containsBOM) { 27 | byte[] copy = new byte[bytes.length - 3]; 28 | System.arraycopy(bytes, 3, copy, 0, bytes.length - 3); 29 | return copy; 30 | } 31 | return bytes; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/util/urlhttp/RealResponse.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.util.urlhttp; 2 | 3 | import java.io.InputStream; 4 | 5 | /** 6 | * Created by fighting on 2017/4/24. 7 | */ 8 | 9 | public class RealResponse { 10 | public InputStream inputStream; 11 | public InputStream errorStream; 12 | public int code; 13 | public long contentLength; 14 | public Exception exception; 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/tvbox/osc/util/urlhttp/ThreadsManager.java: -------------------------------------------------------------------------------- 1 | package com.github.tvbox.osc.util.urlhttp; 2 | 3 | import java.util.Collection; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import java.util.concurrent.ExecutorService; 7 | import java.util.concurrent.Executors; 8 | import java.util.concurrent.Future; 9 | 10 | public class ThreadsManager { 11 | private static ExecutorService mExecutorService; 12 | private static Map mTaskMap = new HashMap(); 13 | 14 | public ThreadsManager() { 15 | } 16 | 17 | static { 18 | } 19 | 20 | public static void init() { 21 | if (mExecutorService == null) { 22 | mExecutorService = Executors.newCachedThreadPool(); 23 | clear(); 24 | } 25 | } 26 | 27 | public static void clear() { 28 | Collection values = mTaskMap.values(); 29 | if (values.size() > 0) { 30 | for (Future hashCode : values) { 31 | stop(Integer.valueOf(hashCode.hashCode())); 32 | } 33 | } 34 | } 35 | 36 | public static Integer post(Runnable runnable) { 37 | if (mExecutorService == null) { 38 | init(); 39 | } 40 | Future submit = mExecutorService.submit(runnable); 41 | Integer valueOf = Integer.valueOf(submit.hashCode()); 42 | mTaskMap.put(Integer.valueOf(submit.hashCode()), submit); 43 | return valueOf; 44 | } 45 | 46 | public static void stop(Integer num) { 47 | Future future = mTaskMap.get(num); 48 | if (future != null) { 49 | mTaskMap.remove(num); 50 | if (!future.isDone() && !future.isCancelled() && mExecutorService != null) { 51 | future.cancel(true); 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/okhttp3/dnsoverhttps/BootstrapDns.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Square, Inc. 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 okhttp3.dnsoverhttps; 17 | 18 | import java.net.InetAddress; 19 | import java.net.UnknownHostException; 20 | import java.util.List; 21 | import okhttp3.Dns; 22 | 23 | /** 24 | * Internal Bootstrap DNS implementation for handling initial connection to DNS over HTTPS server. 25 | * 26 | * Returns hardcoded results for the known host. 27 | */ 28 | final class BootstrapDns implements Dns { 29 | private final String dnsHostname; 30 | private final List dnsServers; 31 | 32 | BootstrapDns(String dnsHostname, List dnsServers) { 33 | this.dnsHostname = dnsHostname; 34 | this.dnsServers = dnsServers; 35 | } 36 | 37 | @Override public List lookup(String hostname) throws UnknownHostException { 38 | if (!this.dnsHostname.equals(hostname)) { 39 | throw new UnknownHostException( 40 | "BootstrapDns called for " + hostname + " instead of " + dnsHostname); 41 | } 42 | 43 | return dnsServers; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/src/main/res/drawable-hdpi/app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/src/main/res/drawable-xhdpi/app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/vod_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/src/main/res/drawable-xhdpi/vod_pause.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/vod_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/src/main/res/drawable-xhdpi/vod_play.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/src/main/res/drawable-xxhdpi/app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/src/main/res/drawable-xxxhdpi/app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/anim_loading.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/app_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/src/main/res/drawable/app_banner.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/app_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/src/main/res/drawable/app_bg.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_channel_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_progress_bar_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/box_controller_top_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_detail_collect.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_detail_play.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_detail_quick_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_detail_sort.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_dialog_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_home_sort_focus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/src/main/res/drawable/icon_back.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_collect.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_delete.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/src/main/res/drawable/icon_empty.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_error.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_filter.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_filter_color.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_history.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_img_placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/src/main/res/drawable/icon_img_placeholder.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/src/main/res/drawable/icon_loading.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/src/main/res/drawable/icon_play.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_pre.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/src/main/res/drawable/icon_pre.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_push.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_search.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_setting.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/src/main/res/drawable/icon_video.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/img_loading_placeholder.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/input_dialog_api_input.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/input_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/item_bg_selector_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/item_bg_selector_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/item_right_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/preview_player_block.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/scrollview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/src/main/res/drawable/scrollview.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/scrollviewleft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/app/src/main/res/drawable/scrollviewleft.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/seekbar_style.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/seekbar_thumb_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/seekbar_thumb_pressed.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 7 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_dialog_bg_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_dialog_filter_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_dialog_pg_search_checkbox.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_live_channel_num.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_live_focus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_live_select.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_play_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_play_mobile_center.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_player_control_vod_seek.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_player_control_vod_seek_thumb.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_player_control_vod_seek_thumb_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_player_control_vod_seek_thumb_press.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_setting_model_focus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_setting_sort_focus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_source_flag_focus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_source_flag_line.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_source_focus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_source_series_focus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_thumb_bottom_name.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_thumb_lang.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_thumb_note.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_thumb_year.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_user_focus.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_user_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/transparent.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 12 | 16 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_play.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 13 | 14 | 22 | 23 | 34 | 35 | 44 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_setting.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 17 | 18 | 23 | 24 | 25 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_about.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_grid_filter.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_remote.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | 15 | 20 | 21 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_xwalk.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 13 | 14 | 26 | 27 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_grid.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_dialog_api_history.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 26 | 27 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_dialog_backup.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 26 | 27 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_dialog_checkbox_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 14 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_dialog_select.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_grid_filter.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 23 | 24 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_grid_filter_value.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_home_sort.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 22 | 23 | 32 | 33 | 42 | 43 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_keyboard.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_live.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 24 | 25 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_live_channel.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 24 | 25 | 36 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_live_channel_group.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_live_setting.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_live_setting_group.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_play_parse.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_quick_search_lite.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_search_lite.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_search_subtitle_result.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 21 | 22 | 32 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_search_word_hot.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_search_word_split.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_series.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_series_flag.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 25 | 26 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_series_group.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_setting_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_keyborad.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/loadsir_empty_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 12 | 13 | 17 | 18 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/loadsir_loading_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/raw/ui.css: -------------------------------------------------------------------------------- 1 | body, 2 | html { 3 | height: 100%; 4 | -webkit-tap-highlight-color: transparent; 5 | } 6 | body { 7 | font-family: system-ui, -apple-system, Helvetica Neue, sans-serif; 8 | } 9 | .page, 10 | body { 11 | background-color: var(--weui-BG-0); 12 | } 13 | .page { 14 | position: absolute; 15 | top: 0; 16 | right: 0; 17 | bottom: 0; 18 | left: 0; 19 | overflow-y: auto; 20 | -webkit-overflow-scrolling: touch; 21 | box-sizing: border-box; 22 | z-index: 1; 23 | } -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #6200EE 4 | #3700B3 5 | #03DAC5 6 | #ffce7900 7 | #1890FF 8 | #FF6600 9 | #00FF0A 10 | #CBF46A 11 | #90CA09 12 | #BD0CADE2 13 | #FF0057 14 | #FF5F00 15 | #FFB6C1 16 | #3D3D3D 17 | #32364E 18 | #6632364E 19 | #BBFFFFFF 20 | #0CADE2 21 | #6CFFFFFF 22 | #66000000 23 | #99000000 24 | #CC000000 25 | #02F8E1 26 | #353744 27 | #CC353744 28 | #6c3d3d3d 29 | #bbffffff 30 | #ffffffff 31 | #33ffffff 32 | #4D000000 33 | #59353744 34 | #66FF0057 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | TVBox 4 | -------------------------------------------------------------------------------- /app/src/main/res/xml/file_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 9 | 12 | 13 | 14 | 17 | 18 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/xml/network_security_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | buildscript { 3 | repositories { 4 | gradlePluginPortal() 5 | google() 6 | mavenCentral() 7 | maven { url "https://jitpack.io" } 8 | //maven { url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2' } 9 | maven { url 'http://home.jundie.top:81/xwalk/maven2' } 10 | // maven { url 'http://9xi4o.tk/maven2' } 11 | maven { url "https://maven.aliyun.com/repository/releases" } 12 | } 13 | dependencies { 14 | classpath "com.android.tools.build:gradle:4.2.1" 15 | 16 | // NOTE: Do not place your application dependencies here; they belong 17 | // in the individual module build.gradle files 18 | } 19 | } 20 | 21 | allprojects { 22 | repositories { 23 | gradlePluginPortal() 24 | google() 25 | mavenCentral() 26 | maven { url "https://jitpack.io" } 27 | //maven { url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2' } 28 | // maven { url 'http://9xi4o.tk/maven2' } 29 | maven { url 'http://home.jundie.top:81/xwalk/maven2' } 30 | maven { url "https://maven.aliyun.com/repository/releases" } 31 | } 32 | } 33 | 34 | task clean(type: Delete) { 35 | delete rootProject.buildDir 36 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app"s APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | IsDebug=true 21 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Sep 21 09:53:05 CST 2021 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /player/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /player/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.library' 3 | } 4 | 5 | android { 6 | compileSdkVersion 30 7 | 8 | defaultConfig { 9 | minSdkVersion 16 10 | targetSdkVersion 26 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | 15 | buildTypes { 16 | all { 17 | ndk { 18 | abiFilters 'armeabi-v7a' 19 | } 20 | } 21 | release { 22 | minifyEnabled false 23 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 24 | } 25 | 26 | releaseSimon.initWith(release) 27 | releaseSimon { 28 | } 29 | } 30 | compileOptions { 31 | sourceCompatibility JavaVersion.VERSION_1_8 32 | targetCompatibility JavaVersion.VERSION_1_8 33 | } 34 | } 35 | 36 | dependencies { 37 | implementation "androidx.annotation:annotation:1.3.0" 38 | api "com.google.android.exoplayer:exoplayer-core:2.14.2" 39 | api "com.google.android.exoplayer:exoplayer-dash:2.14.2" 40 | api "com.google.android.exoplayer:exoplayer-hls:2.14.2" 41 | api "com.google.android.exoplayer:exoplayer-rtsp:2.14.2" 42 | api "com.google.android.exoplayer:extension-rtmp:2.14.2" 43 | api "com.google.android.exoplayer:extension-okhttp:2.14.2" 44 | api 'com.aliyun.sdk.android:AliyunPlayer:4.5.0-full' 45 | api 'com.alivc.conan:AlivcConan:0.9.5' 46 | api 'xyz.doikki.android.dkplayer:dkplayer-ui:3.3.5' 47 | } -------------------------------------------------------------------------------- /player/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /player/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/ISurfaceTextureHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Bilibili 3 | * Copyright (C) 2015 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player; 19 | 20 | import android.graphics.SurfaceTexture; 21 | 22 | public interface ISurfaceTextureHolder { 23 | void setSurfaceTexture(SurfaceTexture surfaceTexture); 24 | 25 | SurfaceTexture getSurfaceTexture(); 26 | 27 | void setSurfaceTextureHost(ISurfaceTextureHost surfaceTextureHost); 28 | } 29 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/ISurfaceTextureHost.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Bilibili 3 | * Copyright (C) 2015 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player; 19 | 20 | import android.graphics.SurfaceTexture; 21 | 22 | public interface ISurfaceTextureHost { 23 | void releaseSurfaceTexture(SurfaceTexture surfaceTexture); 24 | } 25 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/IjkLibLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013-2014 Bilibili 3 | * Copyright (C) 2013-2014 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player; 19 | 20 | public interface IjkLibLoader { 21 | void loadLibrary(String libName) throws UnsatisfiedLinkError, 22 | SecurityException; 23 | } 24 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/IjkTimedText.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Zheng Yuan 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 tv.danmaku.ijk.media.player; 18 | 19 | import android.graphics.Rect; 20 | import java.lang.String; 21 | 22 | public final class IjkTimedText { 23 | 24 | private Rect mTextBounds = null; 25 | private String mTextChars = null; 26 | 27 | public IjkTimedText(Rect bounds, String text) { 28 | mTextBounds = bounds; 29 | mTextChars = text; 30 | } 31 | 32 | public Rect getBounds() { 33 | return mTextBounds; 34 | } 35 | 36 | public String getText() { 37 | return mTextChars; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/MediaInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013-2014 Bilibili 3 | * Copyright (C) 2013-2014 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player; 19 | 20 | public class MediaInfo { 21 | public String mMediaPlayerName; 22 | 23 | public String mVideoDecoder; 24 | public String mVideoDecoderImpl; 25 | 26 | public String mAudioDecoder; 27 | public String mAudioDecoderImpl; 28 | 29 | public IjkMediaMeta mMeta; 30 | } 31 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/annotations/AccessedByNative.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013-2014 Bilibili 3 | * Copyright (C) 2013-2014 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player.annotations; 19 | 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | /** 26 | * is used by the JNI generator to create the necessary JNI 27 | * bindings and expose this method to native code. 28 | */ 29 | @Target(ElementType.FIELD) 30 | @Retention(RetentionPolicy.CLASS) 31 | public @interface AccessedByNative { 32 | } -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/annotations/CalledByNative.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013-2014 Bilibili 3 | * Copyright (C) 2013-2014 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player.annotations; 19 | 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | /** 26 | * is used by the JNI generator to create the necessary JNI 27 | * bindings and expose this method to native code. 28 | */ 29 | @Target(ElementType.METHOD) 30 | @Retention(RetentionPolicy.CLASS) 31 | public @interface CalledByNative { 32 | /* 33 | * If present, tells which inner class the method belongs to. 34 | */ 35 | String value() default ""; 36 | } -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/exceptions/IjkMediaException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013-2014 Bilibili 3 | * Copyright (C) 2013-2014 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player.exceptions; 19 | 20 | public class IjkMediaException extends Exception { 21 | private static final long serialVersionUID = 7234796519009099506L; 22 | } 23 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/ffmpeg/FFmpegApi.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.ijk.media.player.ffmpeg; 2 | 3 | public class FFmpegApi { 4 | public static native String av_base64_encode(byte in[]); 5 | } 6 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/misc/IAndroidIO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Bilibili 3 | * Copyright (C) 2016 Raymond Zheng 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player.misc; 19 | 20 | import java.io.IOException; 21 | 22 | @SuppressWarnings("RedundantThrows") 23 | public interface IAndroidIO { 24 | int open(String url) throws IOException; 25 | int read(byte[] buffer, int size) throws IOException; 26 | long seek(long offset, int whence) throws IOException; 27 | int close() throws IOException; 28 | } 29 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/misc/IMediaDataSource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Bilibili 3 | * Copyright (C) 2015 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player.misc; 19 | 20 | import java.io.IOException; 21 | 22 | @SuppressWarnings("RedundantThrows") 23 | public interface IMediaDataSource { 24 | int readAt(long position, byte[] buffer, int offset, int size) throws IOException; 25 | 26 | long getSize() throws IOException; 27 | 28 | void close() throws IOException; 29 | } 30 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/misc/IMediaFormat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Bilibili 3 | * Copyright (C) 2015 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player.misc; 19 | 20 | public interface IMediaFormat { 21 | // Common keys 22 | String KEY_MIME = "mime"; 23 | 24 | // Video Keys 25 | String KEY_WIDTH = "width"; 26 | String KEY_HEIGHT = "height"; 27 | 28 | String getString(String name); 29 | 30 | int getInteger(String name); 31 | } 32 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/misc/ITrackInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Bilibili 3 | * Copyright (C) 2015 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player.misc; 19 | 20 | public interface ITrackInfo { 21 | int MEDIA_TRACK_TYPE_AUDIO = 2; 22 | int MEDIA_TRACK_TYPE_METADATA = 5; 23 | int MEDIA_TRACK_TYPE_SUBTITLE = 4; 24 | int MEDIA_TRACK_TYPE_TIMEDTEXT = 3; 25 | int MEDIA_TRACK_TYPE_UNKNOWN = 0; 26 | int MEDIA_TRACK_TYPE_VIDEO = 1; 27 | 28 | IMediaFormat getFormat(); 29 | 30 | String getLanguage(); 31 | 32 | int getTrackType(); 33 | 34 | String getInfoInline(); 35 | } 36 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player/pragma/Pragma.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Bilibili 3 | * Copyright (C) 2013 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package tv.danmaku.ijk.media.player.pragma; 18 | 19 | /*- 20 | * configurated by app project 21 | */ 22 | public class Pragma { 23 | public static final boolean ENABLE_VERBOSE = true; 24 | } 25 | -------------------------------------------------------------------------------- /player/src/main/java/tv/danmaku/ijk/media/player_armv7a/Pragma.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Bilibili 3 | * Copyright (C) 2015 Zhang Rui 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package tv.danmaku.ijk.media.player_armv7a; 19 | 20 | public class Pragma { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/aliplayer/AliyunMediaPlayerFactory.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.aliplayer; 2 | 3 | import android.content.Context; 4 | 5 | import xyz.doikki.videoplayer.player.PlayerFactory; 6 | 7 | public class AliyunMediaPlayerFactory extends PlayerFactory { 8 | 9 | public static AliyunMediaPlayerFactory create() { 10 | return new AliyunMediaPlayerFactory(); 11 | } 12 | 13 | @Override 14 | public AliMediaPlayer createPlayer(Context context) { 15 | return new AliMediaPlayer(context); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/controller/IGestureComponent.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.controller; 2 | 3 | public interface IGestureComponent extends IControlComponent { 4 | /** 5 | * 开始滑动 6 | */ 7 | void onStartSlide(); 8 | 9 | /** 10 | * 结束滑动 11 | */ 12 | void onStopSlide(); 13 | 14 | /** 15 | * 滑动调整进度 16 | * @param slidePosition 滑动进度 17 | * @param currentPosition 当前播放进度 18 | * @param duration 视频总长度 19 | */ 20 | void onPositionChange(int slidePosition, int currentPosition, int duration); 21 | 22 | /** 23 | * 滑动调整亮度 24 | * @param percent 亮度百分比 25 | */ 26 | void onBrightnessChange(int percent); 27 | 28 | /** 29 | * 滑动调整音量 30 | * @param percent 音量百分比 31 | */ 32 | void onVolumeChange(int percent); 33 | } 34 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/controller/IVideoController.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.controller; 2 | 3 | public interface IVideoController { 4 | 5 | /** 6 | * 开始控制视图自动隐藏倒计时 7 | */ 8 | void startFadeOut(); 9 | 10 | /** 11 | * 取消控制视图自动隐藏倒计时 12 | */ 13 | void stopFadeOut(); 14 | 15 | /** 16 | * 控制视图是否处于显示状态 17 | */ 18 | boolean isShowing(); 19 | 20 | /** 21 | * 设置锁定状态 22 | * @param locked 是否锁定 23 | */ 24 | void setLocked(boolean locked); 25 | 26 | /** 27 | * 是否处于锁定状态 28 | */ 29 | boolean isLocked(); 30 | 31 | /** 32 | * 开始刷新进度 33 | */ 34 | void startProgress(); 35 | 36 | /** 37 | * 停止刷新进度 38 | */ 39 | void stopProgress(); 40 | 41 | /** 42 | * 显示控制视图 43 | */ 44 | void hide(); 45 | 46 | /** 47 | * 隐藏控制视图 48 | */ 49 | void show(); 50 | 51 | /** 52 | * 是否需要适配刘海 53 | */ 54 | boolean hasCutout(); 55 | 56 | /** 57 | * 获取刘海的高度 58 | */ 59 | int getCutoutHeight(); 60 | } 61 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/controller/MediaPlayerControl.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.controller; 2 | 3 | import android.graphics.Bitmap; 4 | 5 | public interface MediaPlayerControl { 6 | 7 | void start(); 8 | 9 | void pause(); 10 | 11 | long getDuration(); 12 | 13 | long getCurrentPosition(); 14 | 15 | void seekTo(long pos); 16 | 17 | boolean isPlaying(); 18 | 19 | int getBufferedPercentage(); 20 | 21 | void startFullScreen(); 22 | 23 | void stopFullScreen(); 24 | 25 | boolean isFullScreen(); 26 | 27 | void setMute(boolean isMute); 28 | 29 | boolean isMute(); 30 | 31 | void setScreenScaleType(int screenScaleType); 32 | 33 | void setSpeed(float speed); 34 | 35 | float getSpeed(); 36 | 37 | long getTcpSpeed(); 38 | 39 | void replay(boolean resetPosition); 40 | 41 | void setMirrorRotation(boolean enable); 42 | 43 | Bitmap doScreenShot(); 44 | 45 | int[] getVideoSize(); 46 | 47 | void setRotation(float rotation); 48 | 49 | void startTinyScreen(); 50 | 51 | void stopTinyScreen(); 52 | 53 | boolean isTinyScreen(); 54 | } -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/controller/OrientationHelper.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.controller; 2 | 3 | import android.content.Context; 4 | import android.view.OrientationEventListener; 5 | 6 | /** 7 | * 设备方向监听 8 | */ 9 | public class OrientationHelper extends OrientationEventListener { 10 | 11 | private long mLastTime; 12 | 13 | private OnOrientationChangeListener mOnOrientationChangeListener; 14 | 15 | public OrientationHelper(Context context) { 16 | super(context); 17 | } 18 | 19 | @Override 20 | public void onOrientationChanged(int orientation) { 21 | long currentTime = System.currentTimeMillis(); 22 | if (currentTime - mLastTime < 300) return;//300毫秒检测一次 23 | if (mOnOrientationChangeListener != null) { 24 | mOnOrientationChangeListener.onOrientationChanged(orientation); 25 | } 26 | mLastTime = currentTime; 27 | } 28 | 29 | 30 | public interface OnOrientationChangeListener { 31 | void onOrientationChanged(int orientation); 32 | } 33 | 34 | public void setOnOrientationChangeListener(OnOrientationChangeListener onOrientationChangeListener) { 35 | mOnOrientationChangeListener = onOrientationChangeListener; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/exo/ExoMediaPlayerFactory.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.exo; 2 | 3 | import android.content.Context; 4 | 5 | import xyz.doikki.videoplayer.player.PlayerFactory; 6 | 7 | public class ExoMediaPlayerFactory extends PlayerFactory { 8 | 9 | public static ExoMediaPlayerFactory create() { 10 | return new ExoMediaPlayerFactory(); 11 | } 12 | 13 | @Override 14 | public ExoMediaPlayer createPlayer(Context context) { 15 | return new ExoMediaPlayer(context); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/ijk/IjkPlayerFactory.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.ijk; 2 | 3 | import android.content.Context; 4 | 5 | import xyz.doikki.videoplayer.player.PlayerFactory; 6 | 7 | public class IjkPlayerFactory extends PlayerFactory { 8 | 9 | public static IjkPlayerFactory create() { 10 | return new IjkPlayerFactory(); 11 | } 12 | 13 | @Override 14 | public IjkPlayer createPlayer(Context context) { 15 | return new IjkPlayer(context); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/player/AndroidMediaPlayerFactory.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.player; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * 创建{@link AndroidMediaPlayer}的工厂类,不推荐,系统的MediaPlayer兼容性较差,建议使用IjkPlayer或者ExoPlayer 7 | */ 8 | public class AndroidMediaPlayerFactory extends PlayerFactory { 9 | 10 | public static AndroidMediaPlayerFactory create() { 11 | return new AndroidMediaPlayerFactory(); 12 | } 13 | 14 | @Override 15 | public AndroidMediaPlayer createPlayer(Context context) { 16 | return new AndroidMediaPlayer(context); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/player/PlayerFactory.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.player; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * 此接口使用方法: 7 | * 1.继承{@link AbstractPlayer}扩展自己的播放器。 8 | * 2.继承此接口并实现{@link #createPlayer(Context)},返回步骤1中的播放器。 9 | * 可参照{@link AndroidMediaPlayer}和{@link AndroidMediaPlayerFactory}的实现。 10 | */ 11 | public abstract class PlayerFactory

{ 12 | 13 | public abstract P createPlayer(Context context); 14 | } 15 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/player/ProgressManager.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.player; 2 | 3 | /** 4 | * 播放进度管理器,继承此接口实现自己的进度管理器。 5 | */ 6 | public abstract class ProgressManager { 7 | 8 | /** 9 | * 此方法用于实现保存进度的逻辑 10 | * @param url 播放地址 11 | * @param progress 播放进度 12 | */ 13 | public abstract void saveProgress(String url, long progress); 14 | 15 | /** 16 | * 此方法用于实现获取保存的进度的逻辑 17 | * @param url 播放地址 18 | * @return 保存的播放进度 19 | */ 20 | public abstract long getSavedProgress(String url); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/render/IRenderView.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.render; 2 | 3 | import android.graphics.Bitmap; 4 | import android.view.View; 5 | 6 | import androidx.annotation.NonNull; 7 | 8 | import xyz.doikki.videoplayer.player.AbstractPlayer; 9 | 10 | public interface IRenderView { 11 | 12 | /** 13 | * 关联AbstractPlayer 14 | */ 15 | void attachToPlayer(@NonNull AbstractPlayer player); 16 | 17 | /** 18 | * 设置视频宽高 19 | * @param videoWidth 宽 20 | * @param videoHeight 高 21 | */ 22 | void setVideoSize(int videoWidth, int videoHeight); 23 | 24 | /** 25 | * 设置视频旋转角度 26 | * @param degree 角度值 27 | */ 28 | void setVideoRotation(int degree); 29 | 30 | /** 31 | * 设置screen scale type 32 | * @param scaleType 类型 33 | */ 34 | void setScaleType(int scaleType); 35 | 36 | /** 37 | * 获取真实的RenderView 38 | */ 39 | View getView(); 40 | 41 | /** 42 | * 截图 43 | */ 44 | Bitmap doScreenShot(); 45 | 46 | /** 47 | * 释放资源 48 | */ 49 | void release(); 50 | 51 | } -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/render/RenderViewFactory.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.render; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * 此接口用于扩展自己的渲染View。使用方法如下: 7 | * 1.继承IRenderView实现自己的渲染View。 8 | * 2.重写createRenderView返回步骤1的渲染View。 9 | * 可参考{@link TextureRenderView}和{@link TextureRenderViewFactory}的实现。 10 | */ 11 | public abstract class RenderViewFactory { 12 | 13 | public abstract IRenderView createRenderView(Context context); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/render/TextureRenderViewFactory.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.render; 2 | 3 | import android.content.Context; 4 | 5 | public class TextureRenderViewFactory extends RenderViewFactory { 6 | 7 | public static TextureRenderViewFactory create() { 8 | return new TextureRenderViewFactory(); 9 | } 10 | 11 | @Override 12 | public IRenderView createRenderView(Context context) { 13 | return new TextureRenderView(context); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /player/src/main/java/xyz/doikki/videoplayer/util/L.java: -------------------------------------------------------------------------------- 1 | package xyz.doikki.videoplayer.util; 2 | 3 | import android.util.Log; 4 | 5 | import xyz.doikki.videoplayer.player.VideoViewManager; 6 | 7 | /** 8 | * 日志类 9 | * Created by Doikki on 2017/6/5. 10 | */ 11 | 12 | public final class L { 13 | 14 | private L() { 15 | } 16 | 17 | private static final String TAG = "DKPlayer"; 18 | 19 | private static boolean isDebug = VideoViewManager.getConfig().mIsEnableLog; 20 | 21 | 22 | public static void d(String msg) { 23 | if (isDebug) { 24 | Log.d(TAG, msg); 25 | } 26 | } 27 | 28 | public static void e(String msg) { 29 | if (isDebug) { 30 | Log.e(TAG, msg); 31 | } 32 | } 33 | 34 | public static void i(String msg) { 35 | if (isDebug) { 36 | Log.i(TAG, msg); 37 | } 38 | } 39 | 40 | public static void w(String msg) { 41 | if (isDebug) { 42 | Log.w(TAG, msg); 43 | } 44 | } 45 | 46 | public static void setDebug(boolean isDebug) { 47 | L.isDebug = isDebug; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /player/src/main/jniLibs/armeabi-v7a/libijkffmpeg.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/player/src/main/jniLibs/armeabi-v7a/libijkffmpeg.so -------------------------------------------------------------------------------- /player/src/main/jniLibs/armeabi-v7a/libijksdl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/player/src/main/jniLibs/armeabi-v7a/libijksdl.so -------------------------------------------------------------------------------- /player/src/main/jniLibs/armeabi-v7a/libplayer.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/player/src/main/jniLibs/armeabi-v7a/libplayer.so -------------------------------------------------------------------------------- /player/src/main/jniLibs/armeabi-v7a/libxl_stat.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/player/src/main/jniLibs/armeabi-v7a/libxl_stat.so -------------------------------------------------------------------------------- /player/src/main/jniLibs/armeabi-v7a/libxl_thunder_sdk.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nbwzlyd/TVBoxOS/73fe8e93ce72338f48c24ed52d9467068c5ca189/player/src/main/jniLibs/armeabi-v7a/libxl_thunder_sdk.so -------------------------------------------------------------------------------- /player/src/main/res/layout/ijk_demo_activity.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 |