├── .classpath
├── .gitignore
├── .project
├── .settings
├── org.eclipse.core.resources.prefs
└── org.eclipse.jdt.core.prefs
├── AndroidManifest.xml
├── README.md
├── build.gradle
├── build.xml
├── doc
├── 快速开始
│ └── 快速启动.docx
└── 用户手册
│ └── 使用说明书.docx
├── ic_launcher-web.png
├── local.properties
├── project.properties
├── res
├── anim
│ ├── down_to_up_translate.xml
│ ├── down_to_up_translate2.xml
│ ├── left_to_right_translate.xml
│ ├── left_to_right_translate2.xml
│ ├── right_to_left_translate.xml
│ ├── right_to_left_translate2.xml
│ ├── up_to_down_translate.xml
│ ├── up_to_down_translate2.xml
│ ├── video_list_fade_from_right.xml
│ ├── video_list_from_right_in.xml
│ └── zoom_out.xml
├── drawable-hdpi
│ ├── ad_silent_normal.png
│ ├── ad_silent_press.png
│ ├── btn_retry_play.png
│ ├── close_tip.png
│ ├── decoding_setting.png
│ ├── definition_select_bg.9.png
│ ├── dlna_icon.png
│ ├── dlna_list_bg.9.png
│ ├── dlna_unable_icon.png
│ ├── gestrue_brightness.png
│ ├── ic_launcher.png
│ ├── indicater_brightness.png
│ ├── indicater_progress.png
│ ├── indicater_sound.png
│ ├── light_high.png
│ ├── light_low.png
│ ├── more.png
│ ├── net_tip_icon.png
│ ├── orientation_lock_close.png
│ ├── orientation_lock_open.png
│ ├── play_ctrl_back_bg.png
│ ├── play_ctrl_back_press_bg.png
│ ├── play_ctrl_bottom_bg.9.png
│ ├── play_ctrl_fullscreen_bg.png
│ ├── play_ctrl_fullscreen_press_bg.png
│ ├── play_ctrl_pause_bg.png
│ ├── play_ctrl_pause_press_bg.png
│ ├── play_ctrl_play_bg.png
│ ├── play_ctrl_play_press_bg.png
│ ├── play_ctrl_seek_backward.png
│ ├── play_ctrl_seek_forward.png
│ ├── play_ctrl_sound_ball.png
│ ├── play_ctrl_sound_gestrue.png
│ ├── play_ctrl_sound_gestrue_silent.png
│ ├── play_ctrl_title_bg.9.png
│ ├── play_ctrl_video_list_bg.png
│ ├── play_ctrl_video_list_item_bg.png
│ ├── play_ctrl_video_list_press_bg.png
│ ├── play_ctrl_volume_bg.png
│ ├── play_ctrl_volume_press_bg.png
│ ├── play_ctrl_volume_progressbar_bg.png
│ ├── play_error_tip.png
│ ├── play_seek_flag_bg.9.png
│ ├── playbutton_default.png
│ ├── playbutton_press.png
│ ├── player_right_panel_bg.9.png
│ ├── quality_bg_normal.png
│ ├── quality_bg_press.png
│ └── tvicon.png
├── drawable-mdpi
│ └── ic_launcher.png
├── drawable-xhdpi
│ ├── ad_silent_normal.png
│ ├── ad_silent_press.png
│ ├── btn_retry_play.png
│ ├── close_tip.png
│ ├── decoding_setting.png
│ ├── dlna_icon.png
│ ├── dlna_unable_icon.png
│ ├── gestrue_brightness.png
│ ├── ic_launcher.png
│ ├── indicater_brightness.png
│ ├── indicater_progress.png
│ ├── indicater_sound.png
│ ├── light_high.png
│ ├── light_low.png
│ ├── more.png
│ ├── net_tip_icon.png
│ ├── orientation_lock_close.png
│ ├── orientation_lock_open.png
│ ├── play_ctrl_back_bg.png
│ ├── play_ctrl_back_press_bg.png
│ ├── play_ctrl_fullscreen_bg.png
│ ├── play_ctrl_fullscreen_press_bg.png
│ ├── play_ctrl_pause_bg.png
│ ├── play_ctrl_pause_press_bg.png
│ ├── play_ctrl_seek_backward.png
│ ├── play_ctrl_seek_forward.png
│ ├── play_ctrl_sound_ball.png
│ ├── play_ctrl_sound_gestrue.png
│ ├── play_ctrl_sound_gestrue_silent.png
│ ├── play_ctrl_video_list_bg.png
│ ├── play_ctrl_video_list_item_bg.png
│ ├── play_ctrl_video_list_press_bg.png
│ ├── play_ctrl_volume_bg.png
│ ├── play_ctrl_volume_press_bg.png
│ ├── play_ctrl_volume_progressbar_bg.png
│ ├── play_error_tip.png
│ ├── quality_bg_normal.png
│ ├── quality_bg_press.png
│ └── tvicon.png
├── drawable-xxhdpi
│ ├── ad_silent_normal.png
│ ├── ad_silent_press.png
│ ├── btn_retry_play.png
│ ├── close_tip.png
│ ├── decoding_setting.png
│ ├── dlna_icon.png
│ ├── dlna_unable_icon.png
│ ├── gestrue_brightness.png
│ ├── ic_launcher.png
│ ├── indicater_brightness.png
│ ├── indicater_progress.png
│ ├── indicater_sound.png
│ ├── light_high.png
│ ├── light_low.png
│ ├── more.png
│ ├── net_tip_icon.png
│ ├── orientation_lock_close.png
│ ├── orientation_lock_open.png
│ ├── play_ctrl_back_bg.png
│ ├── play_ctrl_back_press_bg.png
│ ├── play_ctrl_fullscreen_bg.png
│ ├── play_ctrl_fullscreen_press_bg.png
│ ├── play_ctrl_pause_bg.png
│ ├── play_ctrl_pause_press_bg.png
│ ├── play_ctrl_seek_backward.png
│ ├── play_ctrl_seek_forward.png
│ ├── play_ctrl_sound_ball.png
│ ├── play_ctrl_sound_gestrue.png
│ ├── play_ctrl_sound_gestrue_silent.png
│ ├── play_ctrl_video_list_bg.png
│ ├── play_ctrl_video_list_press_bg.png
│ ├── play_ctrl_volume_bg.png
│ ├── play_ctrl_volume_press_bg.png
│ ├── play_error_tip.png
│ ├── quality_bg_normal.png
│ ├── quality_bg_press.png
│ └── tvicon.png
├── drawable
│ ├── ad_silent_selcetor.xml
│ ├── pausebutton.xml
│ ├── play_ctrl_back.xml
│ ├── play_ctrl_fullscreen.xml
│ ├── play_ctrl_pause.xml
│ ├── play_ctrl_play.xml
│ ├── play_ctrl_video_list.xml
│ ├── play_ctrl_volume.xml
│ ├── play_ctrl_volume_mute.xml
│ ├── play_seekbar_background.xml
│ ├── play_seekbar_color_bg.xml
│ ├── play_soundseekbar_background.xml
│ ├── playbutton.xml
│ ├── quality_bg.xml
│ └── resolution_textcolor.xml
├── layout
│ ├── default_decodingtype_adapter.xml
│ ├── dlna_connection_layout_include.xml
│ ├── dlna_device_list_item.xml
│ ├── dlna_list_layout_include.xml
│ ├── indicater_layer_include.xml
│ ├── tip_layout.xml
│ └── video_play_error_layout.xml
├── raw
│ └── config.properties
└── values
│ ├── attrs.xml
│ ├── dimes.xml
│ ├── ids.xml
│ └── strings.xml
├── src
└── com
│ └── sina
│ └── sinavideo
│ └── sdk
│ ├── VDVideoADLayer.java
│ ├── VDVideoConfig.java
│ ├── VDVideoExtListeners.java
│ ├── VDVideoView.java
│ ├── VDVideoViewController.java
│ ├── VDVideoViewLayer.java
│ ├── VDVideoViewLayerContext.java
│ ├── VDVideoViewLayerContextData.java
│ ├── VDVideoViewListeners.java
│ ├── container
│ ├── VDVideoADBottomRelativeContainer.java
│ ├── VDVideoADFrameContainer.java
│ ├── VDVideoADGetMoreContainer.java
│ ├── VDVideoADStepoutContainer.java
│ ├── VDVideoControlBottomContainer.java
│ ├── VDVideoControlBottomRelativeContainer.java
│ ├── VDVideoControlContainer.java
│ ├── VDVideoControlDefinitionContainer.java
│ ├── VDVideoControlLightingContainer.java
│ ├── VDVideoControlLoadingContainer.java
│ ├── VDVideoControlPanelContainer.java
│ ├── VDVideoControlProgressContainer.java
│ ├── VDVideoControlRelativeContainer.java
│ ├── VDVideoControlSoundContainer.java
│ ├── VDVideoControlSoundSeekBarContainer.java
│ ├── VDVideoControlTopContainer.java
│ ├── VDVideoControlTopRelativeContainer.java
│ ├── VDVideoOprationpanelContainer.java
│ ├── VDVideoSimpleLinearContainer.java
│ └── VDVideoTipsContainer.java
│ ├── data
│ ├── VDPlayerErrorInfo.java
│ ├── VDPlayerInfo.java
│ ├── VDResolutionData.java
│ ├── VDVideoInfo.java
│ └── VDVideoListInfo.java
│ ├── dlna
│ ├── DLNAButton.java
│ ├── DLNACloseButton.java
│ ├── DLNAController.java
│ ├── DLNAEventListener.java
│ ├── DLNALinearLayout.java
│ ├── DLNAListLinearLayout.java
│ ├── DLNAListView.java
│ ├── DLNANameTextView.java
│ ├── MRContent.java
│ └── MRContentAdapter.java
│ ├── utils
│ ├── VDApplication.java
│ ├── VDFileUtil.java
│ ├── VDGravitySensorManager.java
│ ├── VDLog.java
│ ├── VDMobileUtil.java
│ ├── VDNetworkBroadcastReceiver.java
│ ├── VDPlayPauseHelper.java
│ ├── VDPlayerLightingManager.java
│ ├── VDPlayerSoundManager.java
│ ├── VDResolutionManager.java
│ ├── VDSDKConfig.java
│ ├── VDSharedPreferencesUtil.java
│ ├── VDUtility.java
│ ├── VDVerticalSeekBar.java
│ ├── VDVideoFullModeController.java
│ ├── VDVideoScreenOrientation.java
│ └── m3u8
│ │ ├── M3u8Content.java
│ │ ├── M3u8ContentParser.java
│ │ ├── M3u8ResolutionContent.java
│ │ └── M3u8SegmentContent.java
│ └── widgets
│ ├── VDBaseWidget.java
│ ├── VDVideoADSoundButton.java
│ ├── VDVideoADTicker.java
│ ├── VDVideoBackButton.java
│ ├── VDVideoBottomColorBar.java
│ ├── VDVideoDecodingButton.java
│ ├── VDVideoDecodingView.java
│ ├── VDVideoDefinitionLayout.java
│ ├── VDVideoDefinitionTextView.java
│ ├── VDVideoDescriptionTextView.java
│ ├── VDVideoDoubleTapPlayView.java
│ ├── VDVideoErrorLayout.java
│ ├── VDVideoFullScreenButton.java
│ ├── VDVideoIndicaterLayout.java
│ ├── VDVideoLastTimeTextView.java
│ ├── VDVideoLightingPercentView.java
│ ├── VDVideoLightingSeekBar.java
│ ├── VDVideoLoadingPercentView.java
│ ├── VDVideoLoadingProgress.java
│ ├── VDVideoLockScreenView.java
│ ├── VDVideoMoreOprationButton.java
│ ├── VDVideoPlayButton.java
│ ├── VDVideoPlaySeekBar.java
│ ├── VDVideoProgressIndicaterView.java
│ ├── VDVideoResolutionButton.java
│ ├── VDVideoResolutionList.java
│ ├── VDVideoResolutionListButton.java
│ ├── VDVideoSoundHorizontalSeekBar.java
│ ├── VDVideoSoundSeekBar.java
│ ├── VDVideoSoundSeekButton.java
│ ├── VDVideoSoundSeekImageView.java
│ ├── VDVideoSoundSeekPercentView.java
│ ├── VDVideoTimeTextView.java
│ ├── VDVideoTipLayout.java
│ ├── VDVideoTitleTextView.java
│ └── playlist
│ ├── OnPlayListItemClick.java
│ ├── VDPlayListScrollListener.java
│ ├── VDVideoPlayGridView.java
│ ├── VDVideoPlayListAdapter.java
│ ├── VDVideoPlayListContainer.java
│ ├── VDVideoPlayListGridItemTextView.java
│ ├── VDVideoPlayListView.java
│ ├── VDVideoPlaylistBase.java
│ ├── VDVideoPlaylistTextView.java
│ ├── VDVideoRelatedButton.java
│ └── VDVideoRelatedTextView.java
└── struct.png
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | *.i
3 |
4 | *.txt
5 |
6 | *.d
7 |
8 | .hg/cache/tags
9 |
10 | .hg/cache/branchheads
11 |
12 | .hg/dirstate
13 |
14 | .hg/requires
15 |
16 | .hg/sourcetreeconfig
17 |
18 | .hg/store/fncache
19 |
20 | *.branch
21 |
22 | *.desc
23 |
24 | *.dirstate
25 |
26 | *.bookmarks
27 |
28 | *.phaseroots
29 |
30 | .hg/store/undo
31 |
32 | .hg/store/phaseroots
33 |
34 | *.class
35 |
36 | bin/AndroidManifest.xml
37 |
38 | bin/res/crunch/drawable-hdpi/btn_retry_play.png
39 |
40 | bin/res/crunch/drawable-hdpi/ad_silent_normal.png
41 |
42 | bin/res/crunch/drawable-hdpi/ad_silent_press.png
43 |
44 | bin/res/crunch/drawable-hdpi/close_tip.png
45 |
46 | bin/res/crunch/drawable-hdpi/decoding_setting.png
47 |
48 | copy_branch_to_release.sh
49 |
50 | doc/解码规范/新浪/解码标准.docx
51 |
52 | doc/解码规范/tencent/安卓竞品设备对应清晰度规则.doc
53 |
54 | doc/解码规范/tencent/腾讯视频直播推流规范.docx
55 |
56 | doc/用户手册/播放器层次结构图.graffle
57 |
58 | gen/com/sina/video_playersdkv2/BuildConfig.java
59 |
60 | gen/com/sina/video_playersdkv2/R.java
61 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | sinavideo_playersdk_v2.0
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | encoding/=UTF-8
3 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
3 | org.eclipse.jdt.core.compiler.compliance=1.6
4 | org.eclipse.jdt.core.compiler.source=1.6
5 |
--------------------------------------------------------------------------------
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'android-library'
2 |
3 | dependencies {
4 | compile fileTree(dir: 'libs', include: '*.jar')
5 | compile project(':sinavideo_playercore')
6 | }
7 |
8 | android {
9 | compileSdkVersion 20
10 | buildToolsVersion "22.0.1"
11 |
12 | sourceSets {
13 | main {
14 | manifest.srcFile 'AndroidManifest.xml'
15 | java.srcDirs = ['src']
16 | resources.srcDirs = ['src']
17 | aidl.srcDirs = ['src']
18 | renderscript.srcDirs = ['src']
19 | res.srcDirs = ['res']
20 | assets.srcDirs = ['assets']
21 | }
22 |
23 | // Move the tests to tests/java, tests/res, etc...
24 | instrumentTest.setRoot('tests')
25 |
26 | // Move the build types to build-types/
27 | // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
28 | // This moves them out of them default location under src//... which would
29 | // conflict with src/ being used by the main source set.
30 | // Adding new build types or product flavors should be accompanied
31 | // by a similar customization.
32 | debug.setRoot('build-types/debug')
33 | release.setRoot('build-types/release')
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/doc/快速开始/快速启动.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/doc/快速开始/快速启动.docx
--------------------------------------------------------------------------------
/doc/用户手册/使用说明书.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/doc/用户手册/使用说明书.docx
--------------------------------------------------------------------------------
/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/ic_launcher-web.png
--------------------------------------------------------------------------------
/local.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 |
7 | # location of the SDK. This is only used by Ant
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | sdk.dir=D:\\adt-bundle-windows-x86-20131030\\adt-bundle-windows-x86-20131030\\sdk
11 |
--------------------------------------------------------------------------------
/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-20
15 | android.library=true
16 | android.library.reference.1=../sinavideo_playercore
17 |
--------------------------------------------------------------------------------
/res/anim/down_to_up_translate.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/res/anim/down_to_up_translate2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/res/anim/left_to_right_translate.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
--------------------------------------------------------------------------------
/res/anim/left_to_right_translate2.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
--------------------------------------------------------------------------------
/res/anim/right_to_left_translate.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/res/anim/right_to_left_translate2.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
--------------------------------------------------------------------------------
/res/anim/up_to_down_translate.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
--------------------------------------------------------------------------------
/res/anim/up_to_down_translate2.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/res/anim/video_list_fade_from_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/res/anim/video_list_from_right_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
--------------------------------------------------------------------------------
/res/anim/zoom_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
16 |
17 |
22 |
23 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/ad_silent_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/ad_silent_normal.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ad_silent_press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/ad_silent_press.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/btn_retry_play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/btn_retry_play.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/close_tip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/close_tip.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/decoding_setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/decoding_setting.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/definition_select_bg.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/definition_select_bg.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/dlna_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/dlna_icon.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/dlna_list_bg.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/dlna_list_bg.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/dlna_unable_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/dlna_unable_icon.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/gestrue_brightness.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/gestrue_brightness.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/indicater_brightness.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/indicater_brightness.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/indicater_progress.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/indicater_progress.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/indicater_sound.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/indicater_sound.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/light_high.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/light_high.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/light_low.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/light_low.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/more.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/more.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/net_tip_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/net_tip_icon.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/orientation_lock_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/orientation_lock_close.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/orientation_lock_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/orientation_lock_open.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_back_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_back_bg.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_back_press_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_back_press_bg.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_bottom_bg.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_bottom_bg.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_fullscreen_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_fullscreen_bg.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_fullscreen_press_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_fullscreen_press_bg.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_pause_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_pause_bg.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_pause_press_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_pause_press_bg.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_play_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_play_bg.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_play_press_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_play_press_bg.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_seek_backward.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_seek_backward.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_seek_forward.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_seek_forward.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_sound_ball.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_sound_ball.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_sound_gestrue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_sound_gestrue.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_sound_gestrue_silent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_sound_gestrue_silent.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_title_bg.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_title_bg.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_video_list_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_video_list_bg.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_video_list_item_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_video_list_item_bg.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_video_list_press_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_video_list_press_bg.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_volume_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_volume_bg.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_volume_press_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_volume_press_bg.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_ctrl_volume_progressbar_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_ctrl_volume_progressbar_bg.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_error_tip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_error_tip.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/play_seek_flag_bg.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/play_seek_flag_bg.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/playbutton_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/playbutton_default.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/playbutton_press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/playbutton_press.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/player_right_panel_bg.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/player_right_panel_bg.9.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/quality_bg_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/quality_bg_normal.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/quality_bg_press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/quality_bg_press.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/tvicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-hdpi/tvicon.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ad_silent_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/ad_silent_normal.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ad_silent_press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/ad_silent_press.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/btn_retry_play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/btn_retry_play.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/close_tip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/close_tip.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/decoding_setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/decoding_setting.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/dlna_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/dlna_icon.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/dlna_unable_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/dlna_unable_icon.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/gestrue_brightness.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/gestrue_brightness.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/indicater_brightness.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/indicater_brightness.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/indicater_progress.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/indicater_progress.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/indicater_sound.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/indicater_sound.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/light_high.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/light_high.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/light_low.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/light_low.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/more.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/more.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/net_tip_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/net_tip_icon.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/orientation_lock_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/orientation_lock_close.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/orientation_lock_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/orientation_lock_open.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/play_ctrl_back_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/play_ctrl_back_bg.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/play_ctrl_back_press_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/play_ctrl_back_press_bg.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/play_ctrl_fullscreen_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/play_ctrl_fullscreen_bg.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/play_ctrl_fullscreen_press_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/play_ctrl_fullscreen_press_bg.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/play_ctrl_pause_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/play_ctrl_pause_bg.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/play_ctrl_pause_press_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/play_ctrl_pause_press_bg.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/play_ctrl_seek_backward.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/play_ctrl_seek_backward.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/play_ctrl_seek_forward.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/play_ctrl_seek_forward.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/play_ctrl_sound_ball.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/play_ctrl_sound_ball.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/play_ctrl_sound_gestrue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/play_ctrl_sound_gestrue.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/play_ctrl_sound_gestrue_silent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/play_ctrl_sound_gestrue_silent.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/play_ctrl_video_list_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/play_ctrl_video_list_bg.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/play_ctrl_video_list_item_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/play_ctrl_video_list_item_bg.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/play_ctrl_video_list_press_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/play_ctrl_video_list_press_bg.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/play_ctrl_volume_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/play_ctrl_volume_bg.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/play_ctrl_volume_press_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/play_ctrl_volume_press_bg.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/play_ctrl_volume_progressbar_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/play_ctrl_volume_progressbar_bg.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/play_error_tip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/play_error_tip.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/quality_bg_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/quality_bg_normal.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/quality_bg_press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/quality_bg_press.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/tvicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xhdpi/tvicon.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ad_silent_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/ad_silent_normal.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ad_silent_press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/ad_silent_press.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/btn_retry_play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/btn_retry_play.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/close_tip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/close_tip.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/decoding_setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/decoding_setting.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/dlna_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/dlna_icon.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/dlna_unable_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/dlna_unable_icon.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/gestrue_brightness.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/gestrue_brightness.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/indicater_brightness.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/indicater_brightness.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/indicater_progress.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/indicater_progress.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/indicater_sound.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/indicater_sound.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/light_high.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/light_high.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/light_low.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/light_low.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/more.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/more.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/net_tip_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/net_tip_icon.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/orientation_lock_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/orientation_lock_close.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/orientation_lock_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/orientation_lock_open.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/play_ctrl_back_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/play_ctrl_back_bg.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/play_ctrl_back_press_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/play_ctrl_back_press_bg.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/play_ctrl_fullscreen_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/play_ctrl_fullscreen_bg.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/play_ctrl_fullscreen_press_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/play_ctrl_fullscreen_press_bg.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/play_ctrl_pause_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/play_ctrl_pause_bg.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/play_ctrl_pause_press_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/play_ctrl_pause_press_bg.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/play_ctrl_seek_backward.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/play_ctrl_seek_backward.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/play_ctrl_seek_forward.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/play_ctrl_seek_forward.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/play_ctrl_sound_ball.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/play_ctrl_sound_ball.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/play_ctrl_sound_gestrue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/play_ctrl_sound_gestrue.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/play_ctrl_sound_gestrue_silent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/play_ctrl_sound_gestrue_silent.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/play_ctrl_video_list_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/play_ctrl_video_list_bg.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/play_ctrl_video_list_press_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/play_ctrl_video_list_press_bg.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/play_ctrl_volume_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/play_ctrl_volume_bg.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/play_ctrl_volume_press_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/play_ctrl_volume_press_bg.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/play_error_tip.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/play_error_tip.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/quality_bg_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/quality_bg_normal.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/quality_bg_press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/quality_bg_press.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/tvicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/res/drawable-xxhdpi/tvicon.png
--------------------------------------------------------------------------------
/res/drawable/ad_silent_selcetor.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/drawable/pausebutton.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
9 |
10 |
--------------------------------------------------------------------------------
/res/drawable/play_ctrl_back.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/drawable/play_ctrl_fullscreen.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/drawable/play_ctrl_pause.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/drawable/play_ctrl_play.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/drawable/play_ctrl_video_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/drawable/play_ctrl_volume.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/drawable/play_ctrl_volume_mute.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/res/drawable/play_seekbar_background.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 |
--------------------------------------------------------------------------------
/res/drawable/play_seekbar_color_bg.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 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/res/drawable/play_soundseekbar_background.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 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/res/drawable/playbutton.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
9 |
10 |
--------------------------------------------------------------------------------
/res/drawable/quality_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
8 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/res/drawable/resolution_textcolor.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/layout/default_decodingtype_adapter.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
17 |
18 |
23 |
24 |
--------------------------------------------------------------------------------
/res/layout/dlna_connection_layout_include.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
16 |
17 |
23 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/res/layout/dlna_device_list_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/res/layout/dlna_list_layout_include.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
22 |
25 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/res/layout/indicater_layer_include.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
15 |
16 |
23 |
24 |
31 |
32 |
--------------------------------------------------------------------------------
/res/layout/tip_layout.xml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
17 |
18 |
26 |
27 |
34 |
35 |
--------------------------------------------------------------------------------
/res/layout/video_play_error_layout.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
17 |
18 |
27 |
28 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/res/raw/config.properties:
--------------------------------------------------------------------------------
1 | #player
2 | retrytime=2
3 | #adunitID
4 | #advUnitID=apphead
--------------------------------------------------------------------------------
/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | sinavideo_playersdk_v2.0
4 | Initializing decoders…
5 | Cannot play video
6 | Sorry, this video is not valid for streaming to
7 | this device.
8 | Sorry, this video cannot be played.
9 | OK
10 | Play/Pause
11 | 直播
12 | 正在缓冲
13 | 正在载入
14 | 3D
15 | 超清
16 | 高清
17 | 标清
18 | 流畅
19 |
20 | 无网络连接!
21 | 网络异常!
22 | 网络超时!
23 | 视频无法播放
24 | 对不起,该视频暂时无法播放
25 | 网络不给力,请您检查网络
26 | 网络不给力,正在为您重连
27 | 网络异常,请您检查网络后重试
28 | 您的网络不给力
29 | 播放错误,请点击重试。
30 | #00000000
31 | 高级播放器
32 | 兼容播放器
33 | 切换播放器
34 | 选集
35 |
36 |
37 | 切回手机播放
38 | 已连接至设备:
39 | 请选择列表中的设备
40 | 暂时无法切换播放器
41 | DLNA
42 | 抱歉,该设备无法切换播放器
43 |
44 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/VDVideoADLayer.java:
--------------------------------------------------------------------------------
1 |
2 | package com.sina.sinavideo.sdk;
3 |
4 | import android.content.Context;
5 | import android.util.AttributeSet;
6 | import android.view.View;
7 |
8 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnVideoInsertADListener;
9 | import com.sina.sinavideo.sdk.widgets.VDBaseWidget;
10 |
11 | /**
12 | * 前贴片广告容器,顶层容器,在此容器范围内的组件,全部是广告类型
13 | * 注:一个播放器只能允许一组,横竖屏各一个,超过会导致播放器出错
14 | *
15 | * @author sunxiao
16 | */
17 | public class VDVideoADLayer extends VDVideoViewLayer implements VDBaseWidget, OnVideoInsertADListener {
18 | private Context mContext;
19 | public VDVideoADLayer(Context context) {
20 | super(context);
21 | mContext = context;
22 | }
23 |
24 | public VDVideoADLayer(Context context, AttributeSet attrs) {
25 | super(context, attrs);
26 | }
27 |
28 | @Override
29 | public void reset() {
30 | // TODO Auto-generated method stub
31 | VDVideoViewController controller = VDVideoViewController.getInstance(mContext);
32 | if(controller!=null)
33 | controller.addOnVideoInsertADListener(this);
34 | }
35 |
36 | @Override
37 | public void hide() {
38 | // TODO Auto-generated method stub
39 | VDVideoViewController controller = VDVideoViewController.getInstance(mContext);
40 | if(controller!=null)
41 | controller.removeOnVideoInsertADListener(this);
42 | }
43 |
44 | /**
45 | * 插入广告结束的时候,插入广告显示
46 | */
47 | @Override
48 | public void onVideoInsertADBegin() {
49 | // TODO Auto-generated method stub
50 | setVisibility(View.VISIBLE);
51 | }
52 |
53 | /**
54 | * 插入广告结束的时候,插入广告隐藏
55 | */
56 | @Override
57 | public void onVideoInsertADEnd() {
58 | // TODO Auto-generated method stub
59 | setVisibility(View.GONE);
60 | }
61 |
62 | @Override
63 | public void onVideoInsertADTicker() {
64 | // TODO Auto-generated method stub
65 |
66 | }
67 |
68 | }
69 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/VDVideoConfig.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk;
2 |
3 | /**
4 | * 配置一些常量,用于SDK区别一些特殊状态
5 | *
6 | * @author sunxiao
7 | */
8 | public class VDVideoConfig {
9 |
10 | /**
11 | * 是否是DEBUG状态,区别于是否显示整片日志
12 | */
13 | public final static boolean mIsDebug = true;
14 | /**
15 | * 是否显示屏幕锁
16 | */
17 | public final static boolean mIsScreenLockUI = true;
18 |
19 | /**
20 | * 全屏方式,分别有一下种类:
21 | * eScreenOrientationTypeOnlySensor:纯粹依靠感应器,这种情况下,任何全屏按钮等都不起作用
22 | * eScreenOrientationTypeOnlyManual:纯粹手动控制,感应器无效
23 | * eScreenOrientationTypeBoth:即依靠感应器又依靠手动控制方式[默认]
24 | *
25 | * @author sunxiao
26 | *
27 | */
28 | public enum eVDScreenOrientationType {
29 | eScreenOrientationTypeOnlyManual, eScreenOrientationTypeOnlySensor, eScreenOrientationTypeBoth,
30 | }
31 |
32 | public final static eVDScreenOrientationType mScreenType = eVDScreenOrientationType.eScreenOrientationTypeBoth;
33 |
34 | /**
35 | * 解码方式选择
36 | * eVDDecodingTypeSoft 纯软解方式
37 | * eVDDecodingTypeBothAuto 根据系统白名单自动切换[默认]
38 | * eVDDecodingTypeBothManual 根据VDVideoDecodingButton选择结果处理,默认软解
39 | * eVDDecodingTypeBoth 自动与手动方式都进行,如果点击手动开关,那么就关闭自动选择功能
40 | *
41 | * @author sunxiao
42 | *
43 | */
44 | public enum eVDDecodingType {
45 | eVDDecodingTypeSoft, eVDDecodingTypeBothAuto, eVDDecodingTypeBothManual, eVDDecodingTypeBoth, eVDDecodingTypeHardWare
46 | }
47 |
48 | public static eVDDecodingType mDecodingType = eVDDecodingType.eVDDecodingTypeBoth;
49 |
50 | public final static String[] mDecodingPlayerDesc = {"兼容播放器", "高级播放器"};
51 | public final static String mDecodingPlayerTitle = "切换播放器";
52 | public final static String mDecodingDesc = "想让画质更清晰、手机更省电?请使用高级播放器。";
53 | public final static String mDecodingCancelButton = "取消";
54 | }
55 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/VDVideoViewLayer.java:
--------------------------------------------------------------------------------
1 |
2 | package com.sina.sinavideo.sdk;
3 |
4 | import android.content.Context;
5 | import android.util.AttributeSet;
6 | import android.widget.RelativeLayout;
7 |
8 | /**
9 | * 视频控件层
10 | *
11 | * @author sina
12 | */
13 | public class VDVideoViewLayer extends RelativeLayout {
14 |
15 | // 标明当前layer是否是竖屏组件
16 | public boolean mIsVertical = false;
17 |
18 | public VDVideoViewLayer(Context context) {
19 | super(context);
20 | setBackgroundColor(0x0);
21 | }
22 |
23 | public VDVideoViewLayer(Context context, AttributeSet attrs) {
24 | super(context, attrs);
25 | setBackgroundColor(0x0);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/VDVideoViewLayerContextData.java:
--------------------------------------------------------------------------------
1 |
2 | package com.sina.sinavideo.sdk;
3 |
4 | import java.util.ArrayList;
5 | import java.util.List;
6 |
7 | /**
8 | * VDVideoViewLayerContext的包装类
9 | *
10 | * @author sunxiao
11 | */
12 | public class VDVideoViewLayerContextData {
13 |
14 | public static int LAYER_COMPLEX_ALL = 0;// 复杂模式,横竖全
15 | public static int LAYER_COMPLEX_NOVERTICAL = 1; // 复杂模式,只横不竖
16 | public static int LAYER_SIMPLE = 2; // 简单模式,只竖不横
17 |
18 | /**
19 | * 标识当前页是什么类型,默认是复杂模式,横竖全
20 | */
21 | private int mLayerType = LAYER_COMPLEX_ALL;
22 |
23 | private List mList = new ArrayList();
24 |
25 | public VDVideoViewLayerContextData()
26 | {
27 | super();
28 | }
29 |
30 | public int getLayerType()
31 | {
32 | return mLayerType;
33 | }
34 |
35 | public void setLayerType(int layerType)
36 | {
37 | mLayerType = layerType;
38 | }
39 |
40 | public List getLayerList()
41 | {
42 | return mList;
43 | }
44 |
45 | public void setLayerList(List layerContextList)
46 | {
47 | mList = layerContextList;
48 | }
49 |
50 | public void addLayerContext(VDVideoViewLayerContext layerContext)
51 | {
52 | mList.add(layerContext);
53 | }
54 |
55 | public void removeLayerContext(VDVideoViewLayerContext layerContext)
56 | {
57 | if (mList.contains(layerContext))
58 | {
59 | mList.remove(layerContext);
60 | }
61 | }
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/container/VDVideoADBottomRelativeContainer.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.container;
2 |
3 | import com.sina.sinavideo.sdk.VDVideoViewController;
4 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnShowHideADContainerListener;
5 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnVideoInsertADListener;
6 | import com.sina.sinavideo.sdk.widgets.VDBaseWidget;
7 |
8 | import android.annotation.SuppressLint;
9 | import android.content.Context;
10 | import android.util.AttributeSet;
11 | import android.view.View;
12 | import android.widget.RelativeLayout;
13 |
14 | public class VDVideoADBottomRelativeContainer extends RelativeLayout implements VDBaseWidget, OnVideoInsertADListener,
15 | OnShowHideADContainerListener {
16 | @SuppressLint("nouse")
17 | private Context mContext = null;
18 |
19 | public VDVideoADBottomRelativeContainer(Context context) {
20 | super(context);
21 | init(context);
22 | }
23 |
24 | public VDVideoADBottomRelativeContainer(Context context, AttributeSet attrs) {
25 | super(context, attrs);
26 | init(context);
27 | setVisibility(View.GONE);
28 | // TODO Auto-generated constructor stub
29 | }
30 |
31 | private void init(Context context) {
32 | mContext = context;
33 | }
34 |
35 | @Override
36 | public void hideADContainerBar() {
37 | // TODO Auto-generated method stub
38 | setVisibility(View.GONE);
39 | }
40 |
41 | @Override
42 | public void showADContainerBar() {
43 | // TODO Auto-generated method stub
44 | setVisibility(View.VISIBLE);
45 | }
46 |
47 | @Override
48 | public void onVideoInsertADBegin() {
49 | // TODO Auto-generated method stub
50 | setVisibility(View.VISIBLE);
51 | }
52 |
53 | @Override
54 | public void onVideoInsertADTicker() {
55 | // TODO Auto-generated method stub
56 |
57 | }
58 |
59 | @Override
60 | public void onVideoInsertADEnd() {
61 | // TODO Auto-generated method stub
62 | setVisibility(View.GONE);
63 | }
64 |
65 | @Override
66 | public void reset() {
67 | // TODO Auto-generated method stub
68 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
69 | if(controller!=null)controller.addOnVideoInsertADListener(this);
70 | if(controller!=null)controller.addOnShowHideADContainerListener(this);
71 | }
72 |
73 | @Override
74 | public void hide() {
75 | // TODO Auto-generated method stub
76 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
77 | if(controller!=null)controller.removeOnVideoInsertADListener(this);
78 | if(controller!=null)controller.removeOnShowHideADContainerListener(this);
79 | }
80 |
81 | }
82 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/container/VDVideoADFrameContainer.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.container;
2 |
3 | import android.content.Context;
4 | import android.content.res.TypedArray;
5 | import android.util.AttributeSet;
6 | import android.view.View;
7 | import android.widget.RelativeLayout;
8 |
9 | import com.sina.sinavideo.sdk.VDVideoViewController;
10 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnVideoFrameADListener;
11 | import com.sina.sinavideo.sdk.widgets.VDBaseWidget;
12 | import com.sina.video_playersdkv2.R;
13 |
14 | /**
15 | * 静帧广告容器,仅用于暂停、滑动等情况时候
16 | */
17 | public class VDVideoADFrameContainer extends RelativeLayout implements
18 | VDBaseWidget, OnVideoFrameADListener {
19 | public VDVideoADFrameContainer(Context context) {
20 | super(context);
21 | }
22 |
23 | public VDVideoADFrameContainer(Context context, AttributeSet attrs) {
24 | super(context, attrs);
25 |
26 | int adEnum = 1;
27 | TypedArray typedArray = context.obtainStyledAttributes(attrs,
28 | R.styleable.VDVideoControlPanelContainer);
29 | for (int i = 0; i < typedArray.getIndexCount(); i++) {
30 | if (typedArray.getIndex(i) == R.styleable.VDVideoADFrameContainer_adConfig) {
31 | adEnum = typedArray.getInt(i, 1);
32 | }
33 | }
34 | VDVideoViewController controller = VDVideoViewController
35 | .getInstance(context);
36 | if (null != controller)
37 | controller.mADConfigEnum = adEnum;
38 | typedArray.recycle();
39 | }
40 |
41 | @Override
42 | public void reset() {
43 | // TODO Auto-generated method stub
44 | VDVideoViewController controller = VDVideoViewController
45 | .getInstance(this.getContext());
46 | if (controller != null)
47 | controller.addOnVideoFrameADListener(this);
48 | }
49 |
50 | @Override
51 | public void hide() {
52 | // TODO Auto-generated method stub
53 |
54 | // when both vertical and horizon screen has the FrameADContainer,remove
55 | // listener may cause another container cant receiver the event.
56 |
57 | // VDVideoViewController controller =
58 | // VDVideoViewController.getInstance(this.getContext());
59 | // if(controller!=null)controller.removeOnVideoFrameADListener(this);
60 | }
61 |
62 | @Override
63 | public void onVideoFrameADBegin() {
64 | // TODO Auto-generated method stub
65 | setVisibility(View.VISIBLE);
66 | }
67 |
68 | @Override
69 | public void onVideoFrameADEnd() {
70 | // TODO Auto-generated method stub
71 | setVisibility(View.GONE);
72 | }
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/container/VDVideoADGetMoreContainer.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.container;
2 |
3 | import com.sina.sinavideo.sdk.VDVideoViewController;
4 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnShowHideADContainerListener;
5 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnVideoInsertADListener;
6 | import com.sina.sinavideo.sdk.widgets.VDBaseWidget;
7 |
8 | import android.content.Context;
9 | import android.util.AttributeSet;
10 | import android.view.View;
11 | import android.widget.RelativeLayout;
12 |
13 | /**
14 | * 视频插入式视频广告,了解更多容器
15 | * 在里面可以插入响应的图片或者汉字
16 | *
17 | * @author sunxiao
18 | *
19 | */
20 | public class VDVideoADGetMoreContainer extends RelativeLayout implements VDBaseWidget, OnVideoInsertADListener,
21 | OnShowHideADContainerListener {
22 |
23 | public VDVideoADGetMoreContainer(Context context) {
24 | super(context);
25 | registerListeners();
26 | }
27 |
28 | public VDVideoADGetMoreContainer(Context context, AttributeSet attrs) {
29 | super(context, attrs);
30 | registerListeners();
31 | setVisibility(View.GONE);
32 | }
33 |
34 | private void registerListeners() {
35 | setOnClickListener(new View.OnClickListener() {
36 |
37 | @Override
38 | public void onClick(View v) {
39 | VDVideoViewController controller = VDVideoViewController.getInstance(VDVideoADGetMoreContainer.this.getContext());
40 | if (controller!=null && controller.getExtListener() != null) {
41 | controller.getExtListener().notifyInsertADListenerClick();
42 | }
43 | }
44 | });
45 | }
46 |
47 | @Override
48 | public void reset() {
49 | // TODO Auto-generated method stub
50 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
51 | if(null!=controller)controller.addOnVideoInsertADListener(this);
52 | if(null!=controller)controller.addOnShowHideADContainerListener(this);
53 | }
54 |
55 | @Override
56 | public void hide() {
57 | // TODO Auto-generated method stub
58 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
59 | if(null!=controller)controller.removeOnVideoInsertADListener(this);
60 | if(null!=controller)controller.removeOnShowHideADContainerListener(this);
61 | }
62 |
63 | @Override
64 | public void onVideoInsertADBegin() {
65 | // TODO Auto-generated method stub
66 | setVisibility(View.VISIBLE);
67 | }
68 |
69 | @Override
70 | public void onVideoInsertADEnd() {
71 | // TODO Auto-generated method stub
72 | setVisibility(View.GONE);
73 | }
74 |
75 | @Override
76 | public void onVideoInsertADTicker() {
77 | // TODO Auto-generated method stub
78 |
79 | }
80 |
81 | @Override
82 | public void hideADContainerBar() {
83 | // TODO Auto-generated method stub
84 | setVisibility(View.GONE);
85 | }
86 |
87 | @Override
88 | public void showADContainerBar() {
89 | // TODO Auto-generated method stub
90 | setVisibility(View.VISIBLE);
91 | }
92 |
93 | }
94 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/container/VDVideoADStepoutContainer.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.container;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.View;
6 | import android.widget.RelativeLayout;
7 |
8 | import com.sina.sinavideo.sdk.VDVideoViewController;
9 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnShowHideADContainerListener;
10 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnVideoInsertADListener;
11 | import com.sina.sinavideo.sdk.widgets.VDBaseWidget;
12 |
13 | /**
14 | * 插入式视频广告,『跳过广告按钮』
15 | *
16 | * @author sunxiao
17 | *
18 | */
19 | public class VDVideoADStepoutContainer extends RelativeLayout implements VDBaseWidget, OnVideoInsertADListener,
20 | OnShowHideADContainerListener {
21 |
22 | public VDVideoADStepoutContainer(Context context) {
23 | super(context);
24 | registerListeners();
25 | // TODO Auto-generated constructor stub
26 | }
27 |
28 | public VDVideoADStepoutContainer(Context context, AttributeSet attrs) {
29 | super(context, attrs);
30 | registerListeners();
31 | setVisibility(View.GONE);
32 | // TODO Auto-generated constructor stub
33 | }
34 |
35 | private void registerListeners() {
36 | setOnClickListener(new View.OnClickListener() {
37 |
38 | @Override
39 | public void onClick(View arg0) {
40 | // TODO Auto-generated method stub
41 | // 当前容器被点击,则触发外部的事件响应
42 | VDVideoViewController controller = VDVideoViewController.getInstance(VDVideoADStepoutContainer.this.getContext());
43 | if (controller!=null && controller.getExtListener() != null) {
44 | controller.getExtListener().notifyInsertADListenerStepout();
45 | }
46 | }
47 | });
48 | }
49 |
50 | @Override
51 | public void reset() {
52 | // TODO Auto-generated method stub
53 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
54 | if(controller!=null)controller.addOnVideoInsertADListener(this);
55 | if(controller!=null)controller.addOnShowHideADContainerListener(this);
56 | }
57 |
58 | @Override
59 | public void hide() {
60 | // TODO Auto-generated method stub
61 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
62 | if(controller!=null)controller.removeOnVideoInsertADListener(this);
63 | if(controller!=null)controller.removeOnShowHideADContainerListener(this);
64 | }
65 |
66 | @Override
67 | public void onVideoInsertADBegin() {
68 | // TODO Auto-generated method stub
69 | setVisibility(View.VISIBLE);
70 | }
71 |
72 | @Override
73 | public void onVideoInsertADEnd() {
74 | // TODO Auto-generated method stub
75 | setVisibility(View.GONE);
76 | }
77 |
78 | @Override
79 | public void onVideoInsertADTicker() {
80 | // TODO Auto-generated method stub
81 |
82 | }
83 |
84 | @Override
85 | public void hideADContainerBar() {
86 | // TODO Auto-generated method stub
87 | setVisibility(View.GONE);
88 | }
89 |
90 | @Override
91 | public void showADContainerBar() {
92 | // TODO Auto-generated method stub
93 | setVisibility(View.VISIBLE);
94 | }
95 |
96 | }
97 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/container/VDVideoControlContainer.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.container;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.MotionEvent;
6 | import android.view.View;
7 | import android.widget.LinearLayout;
8 |
9 | import com.sina.sinavideo.sdk.VDVideoViewController;
10 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnScreenTouchListener;
11 | import com.sina.sinavideo.sdk.widgets.VDBaseWidget;
12 |
13 | /**
14 | * 控制条容器类,单击隐藏等操作
15 | *
16 | * @author seven
17 | */
18 | public class VDVideoControlContainer extends LinearLayout implements VDBaseWidget, OnScreenTouchListener {
19 |
20 | public VDVideoControlContainer(Context context) {
21 | super(context);
22 | }
23 |
24 | public VDVideoControlContainer(Context context, AttributeSet attrs) {
25 | super(context, attrs);
26 | }
27 |
28 | @Override
29 | public void onSingleTouch(MotionEvent ev) {
30 | if (getVisibility() == View.GONE) {
31 | setVisibility(View.VISIBLE);
32 | } else {
33 | setVisibility(View.GONE);
34 | }
35 | }
36 |
37 | @Override
38 | public void reset() {
39 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
40 | if(controller!=null)controller.addOnScreenTouchListener(this);
41 | }
42 |
43 | @Override
44 | public void hide() {
45 | setVisibility(GONE);
46 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
47 | if(controller!=null)controller.removeOnScreenTouchListener(this);
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/container/VDVideoControlDefinitionContainer.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.container;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.View;
6 | import android.widget.RelativeLayout;
7 |
8 | import com.sina.sinavideo.sdk.VDVideoViewController;
9 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnVMSResolutionListener;
10 | import com.sina.sinavideo.sdk.utils.VDLog;
11 | import com.sina.sinavideo.sdk.widgets.VDBaseWidget;
12 |
13 | /**
14 | * 清晰度容器
15 | *
16 | * @author GengHongchao
17 | *
18 | */
19 | public class VDVideoControlDefinitionContainer extends RelativeLayout implements OnVMSResolutionListener, VDBaseWidget {
20 |
21 | public VDVideoControlDefinitionContainer(Context context, AttributeSet attrs) {
22 | super(context, attrs);
23 | }
24 |
25 | @Override
26 | public void reset() {
27 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
28 | if(controller!=null)controller.addOnVMSResolutionListener(this);
29 | }
30 |
31 | @Override
32 | public void hide() {
33 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
34 | if(controller!=null)controller.removeOnVMSResolutionListener(this);
35 | }
36 |
37 | private Runnable mHideAction = new Runnable() {
38 |
39 | @Override
40 | public void run() {
41 | setVisibility(View.GONE);
42 | }
43 | };
44 |
45 | @Override
46 | public void onVMSResolutionContainerVisible(boolean isVisible) {
47 | VDLog.i("VDVideoControlDefinitionContainer", "onDefinitionVisible : " + isVisible);
48 | if (isVisible) {
49 | setVisibility(View.VISIBLE);
50 | removeCallbacks(mHideAction);
51 | postDelayed(mHideAction, 3000);
52 | } else {
53 | setVisibility(View.GONE);
54 | }
55 | }
56 |
57 | @Override
58 | public void onVMSResolutionChanged() {
59 | setVisibility(View.GONE);
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/container/VDVideoControlLightingContainer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 调节亮度的容器,单独出来,为了适配OnLightingVisibleListener接口
3 | *
4 | * @author seven
5 | */
6 | package com.sina.sinavideo.sdk.container;
7 |
8 | import android.content.Context;
9 | import android.util.AttributeSet;
10 | import android.view.View;
11 | import android.widget.LinearLayout;
12 |
13 | import com.sina.sinavideo.sdk.VDVideoViewController;
14 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnLightingVisibleListener;
15 | import com.sina.sinavideo.sdk.widgets.VDBaseWidget;
16 |
17 | public class VDVideoControlLightingContainer extends LinearLayout implements OnLightingVisibleListener, VDBaseWidget {
18 |
19 | public VDVideoControlLightingContainer(Context context, AttributeSet attrs) {
20 | super(context, attrs);
21 | // TODO Auto-generated constructor stub
22 | }
23 |
24 | @Override
25 | public void reset() {
26 | // TODO Auto-generated method stub
27 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
28 | if(controller!=null)controller.addOnLightingVisibleListener(this);
29 | }
30 |
31 | @Override
32 | public void hide() {
33 | // TODO Auto-generated method stub
34 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
35 | if(controller!=null)controller.removeOnLightingVisibleListener(this);
36 | }
37 |
38 | @Override
39 | public void onLightingVisible(boolean isVisible) {
40 | // TODO Auto-generated method stub
41 | if (isVisible) {
42 | setVisibility(View.VISIBLE);
43 | } else {
44 | setVisibility(View.GONE);
45 | }
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/container/VDVideoControlLoadingContainer.java:
--------------------------------------------------------------------------------
1 |
2 | package com.sina.sinavideo.sdk.container;
3 |
4 | import com.sina.sinavideo.sdk.VDVideoViewController;
5 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnLoadingListener;
6 | import com.sina.sinavideo.sdk.widgets.VDBaseWidget;
7 |
8 | import android.content.Context;
9 | import android.util.AttributeSet;
10 | import android.view.View;
11 | import android.widget.RelativeLayout;
12 |
13 | public class VDVideoControlLoadingContainer extends RelativeLayout implements VDBaseWidget, OnLoadingListener {
14 |
15 | private Context mContext = null;
16 |
17 | public VDVideoControlLoadingContainer(Context context) {
18 | super(context);
19 | init(context);
20 | }
21 |
22 | public VDVideoControlLoadingContainer(Context context, AttributeSet attrs) {
23 | super(context, attrs);
24 | init(context);
25 | }
26 |
27 | public VDVideoControlLoadingContainer(Context context, AttributeSet attrs, int defStyles) {
28 | super(context, attrs, defStyles);
29 | init(context);
30 | }
31 |
32 | private void init(Context context) {
33 | mContext = context;
34 | }
35 |
36 | @Override
37 | public void showLoading() {
38 | // TODO Auto-generated method stub
39 | setVisibility(View.VISIBLE);
40 | }
41 |
42 | @Override
43 | public void hideLoading() {
44 | // TODO Auto-generated method stub
45 | setVisibility(View.GONE);
46 | }
47 |
48 | @Override
49 | public void reset() {
50 | // TODO Auto-generated method stub
51 | VDVideoViewController controller = VDVideoViewController.getInstance(mContext);
52 | if (controller != null) {
53 | controller.addOnLoadingListener(this);
54 | }
55 | }
56 |
57 | @Override
58 | public void hide() {
59 | // TODO Auto-generated method stub
60 | VDVideoViewController controller = VDVideoViewController.getInstance(mContext);
61 | if (controller != null) {
62 | controller.removeOnLoadingListener(this);
63 | }
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/container/VDVideoControlProgressContainer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 调节亮度的容器,单独出来,为了适配OnLightingVisibleListener接口
3 | *
4 | * @author seven
5 | */
6 | package com.sina.sinavideo.sdk.container;
7 |
8 | import android.content.Context;
9 | import android.util.AttributeSet;
10 | import android.view.View;
11 | import android.widget.LinearLayout;
12 |
13 | import com.sina.sinavideo.sdk.VDVideoViewController;
14 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnProgressViewVisibleListener;
15 | import com.sina.sinavideo.sdk.widgets.VDBaseWidget;
16 |
17 | public class VDVideoControlProgressContainer extends LinearLayout implements OnProgressViewVisibleListener,
18 | VDBaseWidget {
19 |
20 | public VDVideoControlProgressContainer(Context context, AttributeSet attrs) {
21 | super(context, attrs);
22 | // TODO Auto-generated constructor stub
23 | }
24 |
25 | @Override
26 | public void reset() {
27 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
28 | if(controller!=null)controller.addOnProgressViewVisibleListener(this);
29 | }
30 |
31 | @Override
32 | public void hide() {
33 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
34 | if(controller!=null)controller.removeOnProgressViewVisibleListener(this);
35 | setVisibility(GONE);
36 | }
37 |
38 | @Override
39 | public void onProgressVisible(boolean isVisible) {
40 | if (isVisible) {
41 | setVisibility(View.VISIBLE);
42 | } else {
43 | setVisibility(View.GONE);
44 | }
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/container/VDVideoControlRelativeContainer.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.container;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.MotionEvent;
6 | import android.view.View;
7 | import android.widget.RelativeLayout;
8 |
9 | import com.sina.sinavideo.sdk.VDVideoViewController;
10 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnScreenTouchListener;
11 | import com.sina.sinavideo.sdk.widgets.VDBaseWidget;
12 |
13 | /**
14 | * 控制条容器类,单击隐藏等操作
15 | *
16 | * @author seven
17 | */
18 | public class VDVideoControlRelativeContainer extends RelativeLayout implements VDBaseWidget, OnScreenTouchListener {
19 |
20 | public VDVideoControlRelativeContainer(Context context) {
21 | super(context);
22 | }
23 |
24 | public VDVideoControlRelativeContainer(Context context, AttributeSet attrs) {
25 | super(context, attrs);
26 | }
27 |
28 | @Override
29 | public void onSingleTouch(MotionEvent ev) {
30 | if (getVisibility() == View.GONE) {
31 | setVisibility(View.VISIBLE);
32 | } else {
33 | setVisibility(View.GONE);
34 | }
35 | }
36 |
37 | @Override
38 | public void reset() {
39 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
40 | if(controller!=null)controller.addOnScreenTouchListener(this);
41 | }
42 |
43 | @Override
44 | public void hide() {
45 | setVisibility(GONE);
46 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
47 | if(controller!=null)controller.removeOnScreenTouchListener(this);
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/container/VDVideoControlSoundContainer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 音量容器,单独弄出来,为了适配OnSoundVisibleListener接口部分
3 | *
4 | * @author seven
5 | */
6 | package com.sina.sinavideo.sdk.container;
7 |
8 | import android.content.Context;
9 | import android.util.AttributeSet;
10 | import android.view.View;
11 | import android.widget.LinearLayout;
12 |
13 | import com.sina.sinavideo.sdk.VDVideoViewController;
14 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnSoundVisibleListener;
15 | import com.sina.sinavideo.sdk.widgets.VDBaseWidget;
16 |
17 | public class VDVideoControlSoundContainer extends LinearLayout implements OnSoundVisibleListener, VDBaseWidget {
18 |
19 | public VDVideoControlSoundContainer(Context context, AttributeSet attrs) {
20 | super(context, attrs);
21 | // TODO Auto-generated constructor stub
22 | }
23 |
24 | @Override
25 | public void reset() {
26 | // TODO Auto-generated method stub
27 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
28 | if(controller!=null)controller.addOnSoundVisibleListener(this);
29 | }
30 |
31 | @Override
32 | public void hide() {
33 | // TODO Auto-generated method stub
34 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
35 | if(controller!=null)controller.removeOnSoundVisibleListener(this);
36 | }
37 |
38 | @Override
39 | public void onSoundVisible(boolean isVisible) {
40 | if (isVisible) {
41 | setVisibility(View.VISIBLE);
42 | } else {
43 | setVisibility(View.GONE);
44 | }
45 | }
46 |
47 | @Override
48 | public void onSoundSeekBarVisible(boolean isVisible) {
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/container/VDVideoControlSoundSeekBarContainer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 音量容器,单独弄出来,为了适配OnSoundVisibleListener接口部分
3 | *
4 | * @author seven
5 | */
6 | package com.sina.sinavideo.sdk.container;
7 |
8 | import android.content.Context;
9 | import android.util.AttributeSet;
10 | import android.view.View;
11 | import android.widget.RelativeLayout;
12 |
13 | import com.sina.sinavideo.sdk.VDVideoViewController;
14 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnSoundVisibleListener;
15 | import com.sina.sinavideo.sdk.utils.VDLog;
16 | import com.sina.sinavideo.sdk.widgets.VDBaseWidget;
17 |
18 | public class VDVideoControlSoundSeekBarContainer extends RelativeLayout implements OnSoundVisibleListener, VDBaseWidget {
19 |
20 | public VDVideoControlSoundSeekBarContainer(Context context, AttributeSet attrs) {
21 | super(context, attrs);
22 | // TODO Auto-generated constructor stub
23 | }
24 |
25 | @Override
26 | public void reset() {
27 | // TODO Auto-generated method stub
28 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
29 | if(controller!=null)controller.addOnSoundVisibleListener(this);
30 | }
31 |
32 | @Override
33 | public void hide() {
34 | // TODO Auto-generated method stub
35 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
36 | if(controller!=null)controller.removeOnSoundVisibleListener(this);
37 | }
38 |
39 | @Override
40 | public void onSoundVisible(boolean isVisible) {
41 | // if (isVisible) {
42 | // setVisibility(View.VISIBLE);
43 | // } else {
44 | // setVisibility(View.GONE);
45 | // }
46 | }
47 |
48 | @Override
49 | public void onSoundSeekBarVisible(boolean isVisible) {
50 | VDLog.i("VDVideoControlSoundSeekBarContainer", "onSoundSeekBarVisible : " + isVisible);
51 | if (isVisible) {
52 | setVisibility(View.VISIBLE);
53 | removeCallbacks(mHideAction);
54 | postDelayed(mHideAction, 3000);
55 | } else {
56 | setVisibility(View.GONE);
57 | }
58 | }
59 |
60 | private Runnable mHideAction = new Runnable() {
61 |
62 | @Override
63 | public void run() {
64 | setVisibility(View.GONE);
65 | }
66 | };
67 |
68 | }
69 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/container/VDVideoSimpleLinearContainer.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.container;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.LinearLayout;
6 |
7 | import com.sina.sinavideo.sdk.widgets.VDBaseWidget;
8 |
9 | /**
10 | * 控制条容器类,单击隐藏等操作
11 | *
12 | * @author seven
13 | */
14 | public class VDVideoSimpleLinearContainer extends LinearLayout implements VDBaseWidget {
15 |
16 | public VDVideoSimpleLinearContainer(Context context) {
17 | super(context);
18 | }
19 |
20 | public VDVideoSimpleLinearContainer(Context context, AttributeSet attrs) {
21 | super(context, attrs);
22 | }
23 |
24 | @Override
25 | public void reset() {
26 | }
27 |
28 | @Override
29 | public void hide() {
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/container/VDVideoTipsContainer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 播放器新手引导View容器类,单纯的容器类,只是用来标识隐藏与显示tips而已。
3 | *
4 | * @author sunxiao
5 | *
6 | */
7 | package com.sina.sinavideo.sdk.container;
8 |
9 | import android.content.Context;
10 | import android.content.res.TypedArray;
11 | import android.util.AttributeSet;
12 | import android.view.View;
13 | import android.view.ViewGroup;
14 | import android.widget.RelativeLayout;
15 |
16 | import com.sina.sinavideo.sdk.VDVideoViewController;
17 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnVideoGuideTipsListener;
18 | import com.sina.sinavideo.sdk.utils.VDLog;
19 | import com.sina.sinavideo.sdk.widgets.VDBaseWidget;
20 |
21 | public class VDVideoTipsContainer extends RelativeLayout implements VDBaseWidget, OnVideoGuideTipsListener {
22 |
23 | private Context mContext = null;
24 | private final static String TAG = "VDVideoTipsLayout";
25 |
26 | public VDVideoTipsContainer(Context context) {
27 | super(context);
28 |
29 | setVisibility(View.GONE);
30 | init(context);
31 | }
32 |
33 | public VDVideoTipsContainer(Context context, AttributeSet attrs) {
34 | super(context, attrs);
35 | // TODO Auto-generated constructor stub
36 |
37 | // 默认为View.GONE
38 | TypedArray typedArr = context.obtainStyledAttributes(attrs, new int[]{android.R.attr.visible});
39 | if (typedArr != null) {
40 | int visible = typedArr.getInt(0, -1);
41 | if (visible == -1) {
42 | setVisibility(View.GONE);
43 | }
44 | } else {
45 | setVisibility(View.GONE);
46 | }
47 | typedArr.recycle();
48 |
49 | init(context);
50 | }
51 |
52 | private void init(Context context) {
53 | mContext = context;
54 | registerOnclick();
55 | }
56 |
57 | private void registerOnclick() {
58 | setOnClickListener(new View.OnClickListener() {
59 |
60 | @Override
61 | public void onClick(View arg0) {
62 | // TODO Auto-generated method stub
63 | if (mContext == null) {
64 | VDLog.e(VDVideoTipsContainer.TAG, "mContext is null");
65 | return;
66 | }
67 | VDVideoViewController controller = VDVideoViewController.getInstance(VDVideoTipsContainer.this.getContext());
68 | if(null!=controller){
69 | controller.setFirstFullScreen(mContext, false);
70 | controller.notifyGuideTips(false);
71 | }
72 | }
73 | });
74 | }
75 |
76 | @Override
77 | public void reset() {
78 | // TODO Auto-generated method stub
79 | ViewGroup vg = (ViewGroup) getParent();
80 | if (!(vg.getChildAt(0) instanceof VDVideoTipsContainer)) {
81 | // 确保,这个ViewGroup在父View的最上面
82 | vg.bringChildToFront(this);
83 | }
84 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
85 | if(controller!=null)controller.addOnVideoGuideTipsListener(this);
86 | }
87 |
88 | @Override
89 | public void hide() {
90 | // TODO Auto-generated method stub
91 | VDVideoViewController controller = VDVideoViewController.getInstance(this.getContext());
92 | if(controller!=null)controller.removeOnVideoGuideTipsListener(this);
93 | }
94 |
95 | @Override
96 | public void onVisible(boolean isVisible) {
97 | // TODO Auto-generated method stub
98 | // 根据具体的操作实现与隐藏新手教程
99 | if (isVisible) {
100 | setVisibility(View.VISIBLE);
101 | } else {
102 | setVisibility(View.GONE);
103 | }
104 | }
105 |
106 | }
107 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/data/VDPlayerErrorInfo.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.data;
2 |
3 | public class VDPlayerErrorInfo {
4 |
5 | // 从splayer里面的player.h中搬过来的
6 | // NOTE:后期考虑是否需要优化并将错误码合并起来,BTW,错误码实在太乱了
7 | // 主错误
8 | public final static int MEDIA_ERROR_WHAT_UNKNOWN = 0; // MEDIA_ERROR_UNKNOWN:1
9 | public final static int MEDIA_ERROR_WHAT_SERVER_DIED = 2; // MEDIA_ERROR_SERVER_DIED:100
10 | public final static int MEDIA_ERROR_WHAT_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK = 3; // MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK:200
11 | public final static int MEDIA_ERROR_WHAT_M3U8_PARSER = 4; // 自己加的,表示m3u8解析的错误
12 | public final static int MEDIA_ERROR_WHAT_VMS_PARSER = 5; // 自己加的,表示vms网络或者解析错误
13 | // 子错误
14 | public final static int MEDIA_ERROR_EXTRA_PLAYER_UNKNOWN = 0;
15 | public final static int MEDIA_ERROR_EXTRA_PLAYER_IO = 1; // MEDIA_ERROR_IO:-1004
16 | public final static int MEDIA_ERROR_EXTRA_PLAYER_MALFORMED = 2; // MEDIA_ERROR_MALFORMED:-1007
17 | public final static int MEDIA_ERROR_EXTRA_PLAYER_UNSUPPORTED = 3; // MEDIA_ERROR_UNSUPPORTED:-1010
18 | public final static int MEDIA_ERROR_EXTRA_PLAYER_TIMED_OUT = 4; // MEDIA_ERROR_TIMED_OUT:-110
19 | public final static int MEDIA_ERROR_EXTRA_PLAYER_DECODER_FAIL = 5; // MEDIA_ERROR_DECODER_FAIL:-2000
20 | public static final int MEDIA_ERROR_EXTRA_M3U8_NO_CONTENT = 6; // M3u8ContentParser:ERROR_NO_CONTENT:1
21 | public static final int MEDIA_ERROR_EXTRA_M3U8_PARSE = 7; // M3u8ContentParser:ERROR_PARSE:2
22 | public static final int MEDIA_ERROR_EXTRA_VMS_NETWORK_DISABLED = 8; // vms网络错误
23 | public static final int MEDIA_ERROR_EXTRA_VMS_REQUEST_ERROR = 9; // vms网络错误
24 | public static final int MEDIA_ERROR_EXTRA_VMS_RESPONSE_ERROR = 10; // vms网络返回结果错误
25 | public static final int MEDIA_ERROR_EXTRA_VMS_PARSE = 11; // vms_json解析错误
26 | // INFO部分
27 | public static final int MEDIA_INFO_WHAT_UNKNOWN = 0; // MEDIA_INFO_UNKNOWN
28 | public static final int MEDIA_INFO_WHAT_VIDEO_TRACK_LAGGING = 1;// MEDIA_INFO_VIDEO_TRACK_LAGGING
29 | public static final int MEDIA_INFO_WHAT_BUFFERING_START = 2;// MEDIA_INFO_BUFFERING_START
30 | public static final int MEDIA_INFO_WHAT_BUFFERING_END = 3;// MEDIA_INFO_BUFFERING_END
31 | public static final int MEDIA_INFO_WHAT_BAD_INTERLEAVING = 4;// MEDIA_INFO_BAD_INTERLEAVING
32 | public static final int MEDIA_INFO_WHAT_NOT_SEEKABLE = 5;// MEDIA_INFO_NOT_SEEKABLE
33 | public static final int MEDIA_INFO_WHAT_METADATA_UPDATE = 6;// MEDIA_INFO_METADATA_UPDATE
34 | // 贴片广告部分
35 | public static final int MEDIA_INSERTAD_SUCCESS = 0;
36 | public static final int MEDIA_INSERTAD_ERROR_STEPOUT = 1;
37 | public static final int MEDIA_INSERTAD_ERROR_UNKNOWN = 2;
38 | }
39 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/data/VDPlayerInfo.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.data;
2 |
3 | /**
4 | * 播放器状态信息类
5 | *
6 | * @author seven
7 | */
8 | public class VDPlayerInfo {
9 |
10 | // 播放器状态列表
11 | public static final int PLAYER_UNKNOWN = 0;
12 | // 状态循环,从preparing->prepared->starting->started->finishing->finished
13 | // 事件状态,resume/pause/stoped/error
14 | public static final int PLAYER_PREPARING = 1;
15 | public static final int PLAYER_PREPARED = 2;
16 | public static final int PLAYER_STARTING = 3;
17 | public static final int PLAYER_STARTED = 4;
18 | public static final int PLAYER_STOPED = 5;
19 | public static final int PLAYER_RESUME = 6;
20 | public static final int PLAYER_PAUSE = 7;
21 | public static final int PLAYER_FINISHED = 8;
22 | public static final int PLAYER_FINISHING = 9;
23 | public static final int PLAYER_ERROR = 10;
24 |
25 | public boolean isCanScroll() {
26 | return (mPlayStatus == PLAYER_STARTED || mPlayStatus == PLAYER_PAUSE);
27 | }
28 |
29 | /**
30 | * 视频播放状态 0 : playing, 1 : pause
31 | */
32 | public int mPlayStatus = PLAYER_UNKNOWN;
33 |
34 | public boolean isPlaying() {
35 | return (mPlayStatus >= PLAYER_PREPARING && mPlayStatus <= PLAYER_STARTED);
36 | }
37 |
38 | public boolean mIsPlaying = false;
39 |
40 | /**
41 | * 当前播放第几个
42 | */
43 | // public int mIndex = 0;
44 |
45 | /**
46 | * 点播正在解析(获取通过重定向后的)真正url的索引
47 | */
48 | public int mParseIndex = 0;
49 |
50 | public void init() {
51 | // mIndex = 0;
52 | mParseIndex = 0;
53 | }
54 |
55 | /**
56 | * 时长
57 | */
58 | public long mDuration = 0L;
59 | /**
60 | * 当前时刻
61 | */
62 | public long mCurrent = 0L;
63 | /**
64 | * 当前播放器的清晰度
65 | */
66 | public String mCurResolution = VDResolutionData.TYPE_DEFINITION_SD;
67 | public float mCurLighting = 0.f;
68 | public int mCurVolume = 0;
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/dlna/DLNAButton.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.dlna;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.util.Log;
6 | import android.view.View;
7 | import android.widget.ImageButton;
8 |
9 | import com.sina.sinavideo.sdk.VDVideoViewController;
10 | import com.sina.sinavideo.sdk.dlna.DLNAEventListener.OnMediaRenderNumChangedListener;
11 | import com.sina.sinavideo.sdk.utils.VDLog;
12 | import com.sina.video_playersdkv2.R;
13 |
14 | /**
15 | * 当检测到有支持DLNA设备时,播放页面中对应的DLNA设备选择控件
16 | *
17 | * @author sina
18 | *
19 | */
20 | public class DLNAButton extends ImageButton implements OnMediaRenderNumChangedListener {
21 |
22 | public DLNAButton(Context context) {
23 | super(context);
24 | init(context);
25 | VDLog.d("DLNAButton","1 context ctt=" + context);
26 | }
27 |
28 | public DLNAButton(Context context, AttributeSet attrs) {
29 | super(context, attrs);
30 | init(context);
31 | VDLog.d("DLNAButton","2 context ctt=" + context);
32 | }
33 |
34 | public DLNAButton(Context context, AttributeSet attrs, int defStyle) {
35 | super(context, attrs, defStyle);
36 | init(context);
37 | VDLog.d("DLNAButton","3 context ctt=" + context);
38 | }
39 |
40 | private void init(Context context) {
41 | DLNAEventListener.getInstance().addOnMediaRenderNumChangedListener(this);
42 | DLNAEventListener.getInstance().notifyDLNASetUp();
43 | DLNAController.getInstance(getContext()).setUp();
44 | if (DLNAController.getInstance(context).mData.size() > 0) {
45 | setDLNAStatus(true);
46 | } else {
47 | setDLNAStatus(false);
48 | }
49 | setOnClickListener(new View.OnClickListener() {
50 |
51 | @Override
52 | public void onClick(View v) {
53 | if (DLNAController.mIsDLNA) {
54 |
55 | } else {
56 | VDVideoViewController controller = VDVideoViewController.getInstance(DLNAButton.this.getContext());
57 | if(controller!=null)controller.notifyHideControllerBar(0);
58 | // onDLNASwitch(true);
59 | if(controller!=null)controller.notifyRegisterDLNAListener();
60 | DLNAEventListener.getInstance().notifyDLNASetUp();
61 | if(controller!=null)controller.notifyHideMoreOprationPanel();
62 | }
63 | DLNAEventListener.getInstance().notifyDLNAListToogle();
64 | }
65 | });
66 | }
67 |
68 | private void setDLNAStatus(boolean enable){
69 | setEnabled(enable);
70 | if(enable){
71 | setBackgroundResource(R.drawable.dlna_icon);
72 | } else {
73 | setBackgroundResource(R.drawable.dlna_unable_icon);
74 | }
75 | }
76 |
77 | @Override
78 | public void onMediaRenderAdded(String uuid, String name) {
79 | Log.i("DLNA", "DLNAButton onMediaRenderAdded : uuid = " + uuid + " , name = " + name);
80 | setDLNAStatus(true);
81 | // if (getVisibility() != VISIBLE) {
82 | // setVisibility(VISIBLE);
83 | // }
84 | }
85 |
86 | @Override
87 | public void onMediaRenderRemoved(String uuid, String name) {
88 | if (DLNAController.getInstance(getContext()).mData.size() == 0) {
89 | // setVisibility(GONE);
90 | setDLNAStatus(false);
91 | }
92 | }
93 |
94 | }
95 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/dlna/DLNACloseButton.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.dlna;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.View;
6 | import android.widget.TextView;
7 |
8 | /**
9 | * DLNA播放页中关闭按钮控件
10 | *
11 | * @author sina
12 | *
13 | */
14 | public class DLNACloseButton extends TextView {
15 |
16 | public DLNACloseButton(Context context) {
17 | super(context);
18 | init(context);
19 | }
20 |
21 | public DLNACloseButton(Context context, AttributeSet attrs) {
22 | super(context, attrs);
23 | init(context);
24 | }
25 |
26 | public DLNACloseButton(Context context, AttributeSet attrs, int defStyle) {
27 | super(context, attrs, defStyle);
28 | init(context);
29 | }
30 |
31 | private void init(Context context) {
32 | setOnClickListener(new View.OnClickListener() {
33 |
34 | @Override
35 | public void onClick(View v) {
36 | DLNAEventListener.getInstance().notifyDLNAClose();
37 | // DLNAController.getInstance(getContext()).pause();
38 | DLNAController.getInstance(getContext()).stop();
39 | DLNAController.getInstance(getContext()).release();
40 | }
41 | });
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/dlna/DLNALinearLayout.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.dlna;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.LinearLayout;
6 |
7 | import com.sina.sinavideo.sdk.VDVideoViewController;
8 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnDLNALinearLayoutListener;
9 |
10 | /**
11 | * DLNA最外层布局控件
12 | *
13 | * @author sina
14 | *
15 | */
16 | public class DLNALinearLayout extends LinearLayout implements OnDLNALinearLayoutListener {
17 |
18 | public DLNALinearLayout(Context context) {
19 | super(context);
20 | init(context);
21 | }
22 |
23 | public DLNALinearLayout(Context context, AttributeSet attrs) {
24 | super(context, attrs);
25 | init(context);
26 | }
27 |
28 | private void init(Context context) {
29 | VDVideoViewController controller = VDVideoViewController.getInstance(context);
30 | if(controller!=null)controller.addOnDLNALinearLayoutListener(this);
31 | }
32 |
33 | @Override
34 | public void setLayoutVisiable(boolean visiable) {
35 | setVisibility(visiable ? VISIBLE : GONE);
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/dlna/DLNAListLinearLayout.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.dlna;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.LinearLayout;
6 |
7 | import com.sina.sinavideo.sdk.dlna.DLNAEventListener.OnDLNAListSwitchListener;
8 |
9 | /**
10 | * DLNA中间占位图
11 | *
12 | * @author liuqun1
13 | *
14 | */
15 | public class DLNAListLinearLayout extends LinearLayout implements OnDLNAListSwitchListener {
16 |
17 | public DLNAListLinearLayout(Context context) {
18 | super(context);
19 | init(context);
20 | }
21 |
22 | public DLNAListLinearLayout(Context context, AttributeSet attrs) {
23 | super(context, attrs);
24 | init(context);
25 | }
26 |
27 | private void init(Context context) {
28 | DLNAEventListener.getInstance().addOnDLNAListSwitchListener(this);
29 | }
30 |
31 | @Override
32 | public void setUp() {
33 |
34 | }
35 |
36 | @Override
37 | public void onDLNAListSwitch(boolean open) {
38 | if (open) {
39 | setVisibility(VISIBLE);
40 | } else {
41 | setVisibility(GONE);
42 | }
43 | }
44 |
45 | @Override
46 | public void toggle() {
47 | if (getVisibility() == VISIBLE) {
48 | setVisibility(GONE);
49 | } else {
50 | setVisibility(VISIBLE);
51 | }
52 |
53 | }
54 |
55 | @Override
56 | public void hide() {
57 | if(getVisibility() == VISIBLE){
58 | setVisibility(GONE);
59 | }
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/dlna/DLNANameTextView.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.dlna;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.TextView;
6 |
7 | import com.sina.sinavideo.sdk.dlna.DLNAEventListener.OnDLNASelectedListener;
8 | import com.sina.video_playersdkv2.R;
9 |
10 | /**
11 | * 显示通过DLNA链接的设备名称控件
12 | *
13 | * @author sina
14 | *
15 | */
16 | public class DLNANameTextView extends TextView implements OnDLNASelectedListener {
17 |
18 | private String mName;
19 | // private String mValue;
20 | private String mPrefix;
21 |
22 | public DLNANameTextView(Context context) {
23 | super(context);
24 | init(context);
25 | }
26 |
27 | public DLNANameTextView(Context context, AttributeSet attrs) {
28 | super(context, attrs);
29 | init(context);
30 | }
31 |
32 | public DLNANameTextView(Context context, AttributeSet attrs, int defStyle) {
33 | super(context, attrs, defStyle);
34 | init(context);
35 | }
36 |
37 | private void init(Context context) {
38 | mPrefix = context.getString(R.string.dlna_connect_to_device);
39 | DLNAEventListener.getInstance().addOnDLNASelectedListener(this);
40 | }
41 |
42 | @Override
43 | public void onMediaRenderSelect(String name, String value) {
44 | mName = name;
45 | // mValue = value;
46 | }
47 |
48 | @Override
49 | public void onMediaRenderOpened(boolean opened) {
50 | if (opened) {
51 | if (mName != null) {
52 | setText(mPrefix + mName);
53 | }
54 | } else {
55 | setText(mPrefix);
56 | }
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/dlna/MRContent.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.dlna;
2 |
3 | /**
4 | * 支持DLNA设备的实体类
5 | *
6 | * @author sina
7 | *
8 | */
9 | public class MRContent {
10 |
11 | private String uuid;
12 | private String name;
13 |
14 | public void setUuid(String uuid) {
15 | this.uuid = uuid;
16 | }
17 |
18 | public String getUuid() {
19 | return this.uuid;
20 | }
21 |
22 | public void setName(String name) {
23 | this.name = name;
24 | }
25 |
26 | public String getName() {
27 | return this.name;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/dlna/MRContentAdapter.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.dlna;
2 |
3 | import java.util.ArrayList;
4 |
5 | import android.content.Context;
6 | import android.graphics.Color;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 | import android.widget.BaseAdapter;
11 | import android.widget.TextView;
12 |
13 | import com.sina.video_playersdkv2.R;
14 |
15 | /**
16 | * 搜索到支持DLNA的设备适配器
17 | *
18 | * @author sina
19 | *
20 | */
21 | public class MRContentAdapter extends BaseAdapter {
22 |
23 | private LayoutInflater mInflater;
24 | public ArrayList mData;
25 | private int mSelectPosition = -1;
26 | private int mSelectColor;
27 |
28 | public void setSelectPosition(int p) {
29 | mSelectPosition = p;
30 | notifyDataSetChanged();
31 | }
32 |
33 | public MRContentAdapter(Context context) {
34 | super();
35 | mInflater = LayoutInflater.from(context);
36 | // mData = new ArrayList();
37 | mSelectColor = Color.parseColor("#0662ad");
38 | mData = DLNAController.getInstance(context).mData;
39 | }
40 |
41 | @Override
42 | public int getCount() {
43 | return mData.size();
44 | }
45 |
46 | @Override
47 | public Object getItem(int arg0) {
48 | return mData.get(arg0);
49 | }
50 |
51 | @Override
52 | public long getItemId(int arg0) {
53 | return arg0;
54 | }
55 |
56 | @Override
57 | public View getView(final int position, View view, ViewGroup arg2) {
58 | if (view == null) {
59 | ViewGroup group = null;
60 | view = mInflater.inflate(R.layout.dlna_device_list_item, group);
61 | }
62 | final TextView name = (TextView) view.findViewById(R.id.mr_name);
63 | name.setText(mData.get(position).getName());
64 | if (position == mSelectPosition) {
65 | name.setBackgroundColor(mSelectColor);
66 | } else {
67 | name.setBackgroundColor(0);
68 | }
69 | return view;
70 | }
71 |
72 | public void addMR(String uuid, String name) {
73 | // MRContent mr = new MRContent();
74 | // mr.setUuid(uuid);
75 | // mr.setName(name);
76 | // mData.add(mr);
77 |
78 | // TODO
79 | // mr = new MRContent();
80 | // mr.setUuid(uuid);
81 | // mr.setName("测试DLNA");
82 | // mData.add(mr);
83 | notifyDataSetChanged();
84 | }
85 |
86 | public void removeMR(String uuid, String name) {
87 | // for (int i = 0; i < mData.size(); i++) {
88 | // if (mData.get(i) != null && mData.get(i).getUuid().equals(uuid)) {
89 | // mData.remove(mData.get(i));
90 | // break;
91 | // }
92 | // }
93 | notifyDataSetChanged();
94 | }
95 |
96 | public String getMR(int position) {
97 | if (mData.get(position) != null) {
98 | return mData.get(position).getUuid();
99 | }
100 | return null;
101 | }
102 |
103 | public void removeAll() {
104 | // if(mData != null){
105 | // mData.clear();
106 | // }
107 | mSelectPosition = -1;
108 | notifyDataSetChanged();
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/utils/VDApplication.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.utils;
2 |
3 | import com.sina.sinavideo.coreplayer.splayer.SPlayer;
4 |
5 | import android.content.Context;
6 | import android.content.pm.PackageInfo;
7 | import android.content.pm.PackageManager.NameNotFoundException;
8 | import android.net.ConnectivityManager;
9 | import android.net.NetworkInfo;
10 |
11 | public class VDApplication {
12 |
13 | private Context mContext = null;
14 | public boolean mDebug = true;
15 |
16 | private static final String TAG = "VDApplication";
17 |
18 | private static class VDApplicationINSTANCE {
19 |
20 | static VDApplication instance = new VDApplication();
21 | }
22 |
23 | public static VDApplication getInstance() {
24 | return VDApplicationINSTANCE.instance;
25 | }
26 |
27 | public void initPlayer(Context context) {
28 | setContext(context);
29 | SPlayer.initialize(context);
30 | }
31 |
32 | public void setContext(Context context) {
33 | VDLog.d(TAG, "setContext:" + context);
34 | if (mContext == null) {
35 | mContext = context.getApplicationContext();
36 | }
37 | }
38 |
39 | public Context getContext() {
40 | VDLog.d(TAG, "getContext");
41 | return mContext;
42 | }
43 |
44 | public void release() {
45 | // 使用了新的controller后,不再release,否则,可能导致mContext为null,导致播放器中的延时操作等语句出现NullException
46 | // VDLog.d(TAG, "release");
47 | // mContext = null;
48 | }
49 |
50 | public String getAPPName() {
51 | if (mContext == null) {
52 | return "";
53 | }
54 | return mContext.getPackageName();
55 | }
56 |
57 | public String getAPPVersion() {
58 | if (mContext == null) {
59 | return "";
60 | }
61 | try {
62 | PackageInfo packInfo = mContext.getPackageManager().getPackageInfo(
63 | mContext.getPackageName(), 0);
64 | return packInfo.versionName;
65 | } catch (NameNotFoundException e) {
66 | e.printStackTrace();
67 | }
68 | return "";
69 | }
70 |
71 | public String getDeviceName() {
72 | return android.os.Build.MODEL;
73 | }
74 |
75 | public String getAndroidVersion() {
76 | return android.os.Build.VERSION.RELEASE;
77 | }
78 |
79 | /**
80 | * 网络是否已连接
81 | *
82 | * @param context
83 | * @return
84 | */
85 | public boolean isNetworkConnected() {
86 | try {
87 | ConnectivityManager cm = (ConnectivityManager) mContext
88 | .getSystemService(Context.CONNECTIVITY_SERVICE);
89 | if (cm == null) {
90 | return false;
91 | }
92 | NetworkInfo networkInfo = cm.getActiveNetworkInfo();
93 | return networkInfo != null && networkInfo.isConnected();
94 | } catch (NullPointerException e) {
95 | VDLog.d(TAG, e.getMessage());
96 | // e.printStackTrace();
97 | return false;
98 | }
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/utils/VDLog.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.utils;
2 |
3 | import android.util.Log;
4 |
5 | public class VDLog {
6 |
7 | /**
8 | * 打印debug级别的日志
9 | *
10 | * @param tag
11 | * Used to identify the source of a log message. It usually
12 | * identifies the class or activity where the log call occurs.
13 | * @param msg
14 | * The message you would like logged.
15 | * @return The number of bytes written.
16 | */
17 | public static int d(String tag, String msg) {
18 | if (VDApplication.getInstance().mDebug) {
19 | if (msg == null) {
20 | msg = "null";
21 | }
22 | return Log.d(tag, msg);
23 | }
24 | return 0;
25 | }
26 |
27 | public static int i(String tag, String msg) {
28 | if (VDApplication.getInstance().mDebug) {
29 | if (msg == null) {
30 | msg = "null";
31 | }
32 | return Log.i(tag, msg);
33 | }
34 | return 0;
35 | }
36 |
37 | public static int v(String tag, String msg) {
38 | if (VDApplication.getInstance().mDebug) {
39 | if (msg == null) {
40 | msg = "null";
41 | }
42 | return Log.v(tag, msg);
43 | }
44 | return 0;
45 | }
46 |
47 | /**
48 | * 打印debug级别的日志
49 | *
50 | * @param tag
51 | * Used to identify the source of a log message. It usually
52 | * identifies the class or activity where the log call occurs.
53 | * @param msg
54 | * The message you would like logged.
55 | * @param tr
56 | * An exception to log
57 | * @return The number of bytes written.
58 | */
59 | public static int d(String tag, String msg, Throwable tr) {
60 | if (VDApplication.getInstance().mDebug) {
61 | if (msg == null) {
62 | msg = "null";
63 | }
64 | return Log.d(tag, msg, tr);
65 | }
66 | return 0;
67 | }
68 |
69 | public static int i(String tag, String msg, Throwable tr) {
70 | if (VDApplication.getInstance().mDebug) {
71 | if (msg == null) {
72 | msg = "null";
73 | }
74 | return Log.i(tag, msg, tr);
75 | }
76 | return 0;
77 | }
78 |
79 | public static int w(String tag, String msg) {
80 | if (VDApplication.getInstance().mDebug) {
81 | if (msg == null) {
82 | msg = "null";
83 | }
84 | return Log.w(tag, msg);
85 | }
86 | return 0;
87 | }
88 |
89 | public static int w(String tag, String msg, Throwable tr) {
90 | if (VDApplication.getInstance().mDebug) {
91 | if (msg == null) {
92 | msg = "null";
93 | }
94 | return Log.w(tag, msg, tr);
95 | }
96 | return 0;
97 | }
98 |
99 | public static int e(String tag, String msg) {
100 | if (VDApplication.getInstance().mDebug) {
101 | if (msg == null) {
102 | msg = "null";
103 | }
104 | return Log.e(tag, msg);
105 | }
106 | return 0;
107 | }
108 |
109 | public static int e(String tag, String msg, Throwable tr) {
110 | if (VDApplication.getInstance().mDebug) {
111 | if (msg == null) {
112 | msg = "null";
113 | }
114 | return Log.e(tag, msg, tr);
115 | }
116 | return 0;
117 | }
118 |
119 | }
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/utils/VDPlayPauseHelper.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.utils;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Context;
5 |
6 | import com.sina.sinavideo.sdk.VDVideoViewController;
7 |
8 | public class VDPlayPauseHelper {
9 |
10 | @SuppressLint("unused")
11 | private Context mContext;
12 |
13 | public VDPlayPauseHelper(Context ctt) {
14 | mContext = ctt;
15 | }
16 |
17 | public void doClick() {
18 | VDVideoViewController controller = VDVideoViewController
19 | .getInstance(mContext);
20 | if (null == controller)
21 | return;
22 | // 先测试添加于此
23 | if (controller.mVDPlayerInfo.mIsPlaying) {
24 | controller.pause();
25 | if (controller.isCanShowFrameAD()) {
26 | controller.notifyVideoFrameADBegin();
27 | }
28 | } else {
29 | controller.resume();
30 | controller.start();
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/utils/VDPlayerSoundManager.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.utils;
2 |
3 | import com.sina.sinavideo.sdk.VDVideoViewController;
4 | import com.sina.sinavideo.sdk.dlna.DLNAController;
5 |
6 | import android.app.Service;
7 | import android.content.Context;
8 | import android.media.AudioManager;
9 |
10 | /**
11 | * 音量控制类,简单点处理,直接用静态方法来代替了。可能单例会更好一点
12 | *
13 | * @author alexsun
14 | *
15 | */
16 | public class VDPlayerSoundManager {
17 |
18 | private static int mCurrSoundNum = -1;
19 |
20 | private static AudioManager getAudioManager(Context context) {
21 | if (context == null) {
22 | return null;
23 | }
24 | return (AudioManager) context.getSystemService(Service.AUDIO_SERVICE);
25 | }
26 |
27 | /**
28 | * 清理相关静态变量等的资源
29 | */
30 | public static void clear() {
31 | mCurrSoundNum = -1;
32 | }
33 |
34 | /**
35 | * 调节音量
36 | *
37 | * @param currVolume
38 | * 当前音量值
39 | * @param notify
40 | * 是否有通知
41 | */
42 | public static void dragSoundSeekTo(Context context, int currVolume,
43 | boolean notify) {
44 | if (DLNAController.mIsDLNA) {
45 | DLNAController.getInstance(context).mVolume = currVolume;
46 | DLNAController.getInstance(context).setVolume(currVolume);
47 | } else {
48 | if (getAudioManager(context) != null) {
49 | getAudioManager(context).setStreamVolume(
50 | AudioManager.STREAM_MUSIC, currVolume, 0);
51 | }
52 | }
53 | VDVideoViewController controller = VDVideoViewController
54 | .getInstance(context);
55 | if (null != controller) {
56 | controller.mVDPlayerInfo.mCurVolume = currVolume;
57 | if (notify) {
58 | controller.notifySoundChanged(currVolume);
59 | }
60 | }
61 | }
62 |
63 | /**
64 | * 得到当前最大音量
65 | *
66 | * @return
67 | */
68 | public static int getMaxSoundVolume(Context context) {
69 | if (getAudioManager(context) != null) {
70 | return getAudioManager(context).getStreamMaxVolume(
71 | AudioManager.STREAM_MUSIC);
72 | }
73 | return 0;
74 | }
75 |
76 | /**
77 | * 得到当前音量
78 | *
79 | * @return
80 | */
81 | public static int getCurrSoundVolume(Context context) {
82 | if (getAudioManager(context) != null) {
83 | return getAudioManager(context).getStreamVolume(
84 | AudioManager.STREAM_MUSIC);
85 | }
86 | return 0;
87 | }
88 |
89 | /**
90 | * 获取是否静音
91 | *
92 | * @return
93 | */
94 | public static boolean isMuted(Context context) {
95 | AudioManager audioManager = (AudioManager) context
96 | .getSystemService(Service.AUDIO_SERVICE);
97 | int currSoundNum = -1;
98 | if (audioManager != null) {
99 | currSoundNum = audioManager
100 | .getStreamVolume(AudioManager.STREAM_MUSIC);
101 | }
102 | return (currSoundNum == 0);
103 | }
104 |
105 | /**
106 | * 设置静音
107 | *
108 | * @param isMuted
109 | */
110 | public static void setMute(Context context, boolean isMuted,
111 | boolean needNotify) {
112 | AudioManager audioManager = (AudioManager) context
113 | .getSystemService(Service.AUDIO_SERVICE);
114 | if (audioManager == null) {
115 | return;
116 | }
117 | if (isMuted) {
118 | mCurrSoundNum = audioManager
119 | .getStreamVolume(AudioManager.STREAM_MUSIC);
120 | dragSoundSeekTo(context, 0, needNotify);
121 | } else {
122 | if (mCurrSoundNum != -1) {
123 | dragSoundSeekTo(context, mCurrSoundNum, needNotify);
124 | }
125 | }
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/utils/VDSDKConfig.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.utils;
2 |
3 | /**
4 | * 配置管理器,管理raw/config.properties的配置文件信息
5 | *
6 | * @sunxiao 注解:
7 | * 不读了。就剩一个配置选项了。直接写死在里面,要是调整的话,直接改常数就行了。
8 | *
9 | * @author alexsun
10 | *
11 | */
12 | public class VDSDKConfig {
13 |
14 | private final static int mRetryTime = 2;
15 |
16 | public VDSDKConfig() {
17 | }
18 |
19 | private static class VDSDKConfigINSTANCE {
20 |
21 | private static VDSDKConfig instance = new VDSDKConfig();
22 | }
23 |
24 | public static VDSDKConfig getInstance() {
25 | return VDSDKConfigINSTANCE.instance;
26 | }
27 |
28 | public int getRetryTime() {
29 | return mRetryTime;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/utils/VDVerticalSeekBar.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.utils;
2 |
3 | import android.content.Context;
4 | import android.graphics.Canvas;
5 | import android.util.AttributeSet;
6 | import android.util.Log;
7 | import android.view.MotionEvent;
8 | import android.widget.SeekBar;
9 |
10 | public class VDVerticalSeekBar extends SeekBar {
11 |
12 | protected boolean mIsDragging = false;
13 |
14 | public VDVerticalSeekBar(Context context) {
15 | super(context);
16 | }
17 |
18 | public VDVerticalSeekBar(Context context, AttributeSet attrs, int defStyle) {
19 | super(context, attrs, defStyle);
20 | }
21 |
22 | public VDVerticalSeekBar(Context context, AttributeSet attrs) {
23 | super(context, attrs);
24 | }
25 |
26 | @Override
27 | protected void onSizeChanged(int w, int h, int oldw, int oldh) {
28 | super.onSizeChanged(h, w, oldh, oldw);
29 | }
30 |
31 | @Override
32 | protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
33 | super.onMeasure(heightMeasureSpec, widthMeasureSpec);
34 | setMeasuredDimension(getMeasuredHeight(), getMeasuredWidth());
35 | }
36 |
37 | @Override
38 | protected void onDraw(Canvas c) {
39 | c.rotate(-90);
40 | c.translate(-getHeight(), 0);
41 |
42 | super.onDraw(c);
43 | }
44 |
45 | @Override
46 | public boolean onTouchEvent(MotionEvent event) {
47 | if (!isEnabled()) {
48 | return false;
49 | }
50 |
51 | switch (event.getAction()) {
52 | case MotionEvent.ACTION_DOWN :
53 | mIsDragging = true;
54 | case MotionEvent.ACTION_MOVE :
55 | setProgress(getMax() - (int) (getMax() * event.getY() / getHeight()));
56 | Log.i("Progress", getProgress() + "");
57 | onSizeChanged(getWidth(), getHeight(), 0, 0);
58 | break;
59 | case MotionEvent.ACTION_UP :
60 | mIsDragging = false;
61 | setProgress(getMax() - (int) (getMax() * event.getY() / getHeight()));
62 | Log.i("Progress", getProgress() + "");
63 | onSizeChanged(getWidth(), getHeight(), 0, 0);
64 | break;
65 |
66 | case MotionEvent.ACTION_CANCEL :
67 | mIsDragging = false;
68 | break;
69 | }
70 | return true;
71 | }
72 |
73 | }
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/utils/m3u8/M3u8Content.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.utils.m3u8;
2 |
3 | /**
4 | * m3u8实体基础类
5 | *
6 | * @author GengHongchao
7 | *
8 | */
9 | public class M3u8Content {
10 |
11 | public static final int M3U8_TYPE_UNKNOWN = 0;
12 | public static final int M3U8_TYPE_SEGMENT = 1;
13 | public static final int M3U8_TYPE_RESOLUTION = 2;
14 |
15 | protected int mType;
16 |
17 | public int getType() {
18 | return mType;
19 | }
20 | }
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/utils/m3u8/M3u8ResolutionContent.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.utils.m3u8;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | public class M3u8ResolutionContent extends M3u8Content {
7 |
8 | public M3u8ResolutionContent() {
9 | mType = M3U8_TYPE_RESOLUTION;
10 | mResolutionList = new ArrayList();
11 | }
12 |
13 | private List mResolutionList;
14 |
15 | public static class M3u8Resolution {
16 |
17 | public static final int M3U8_RESOLUTION_TYPE_SD = 0;
18 | public static final int M3U8_RESOLUTION_TYPE_HD = 1;
19 | public static final int M3U8_RESOLUTION_TYPE_XHD = 2;
20 | public static final int M3U8_RESOLUTION_TYPE_3D = 3;
21 |
22 | public int mResolutionType;
23 | public int mProgramId;
24 | public int mBandWidth;
25 | public String mM3u8Url;
26 | }
27 |
28 | public void setResolutionList(List list) {
29 | mResolutionList = list;
30 | }
31 |
32 | public List getResolutionList() {
33 | return mResolutionList;
34 | }
35 | }
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/utils/m3u8/M3u8SegmentContent.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.utils.m3u8;
2 |
3 |
4 | public class M3u8SegmentContent extends M3u8Content {
5 |
6 | public M3u8SegmentContent() {
7 | mType = M3U8_TYPE_SEGMENT;
8 | }
9 |
10 | // private int mTargetDuration;
11 | // private List mM3u8SegmentList;
12 |
13 | public static class M3u8Segment {
14 |
15 | public int mDuration;
16 | public String mUrl;
17 | }
18 | }
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDBaseWidget.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets;
2 |
3 | /**
4 | * 所有自定义控件的基础接口
5 | *
6 | * @author GengHongchao
7 | *
8 | */
9 | public interface VDBaseWidget {
10 |
11 | /**
12 | * 恢复设置
13 | */
14 | public void reset();
15 |
16 | /**
17 | * 隐藏
18 | */
19 | public void hide();
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoADSoundButton.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets;
2 |
3 | import com.sina.sinavideo.sdk.VDVideoViewController;
4 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnSoundChangedListener;
5 | import com.sina.sinavideo.sdk.utils.VDPlayerSoundManager;
6 | import com.sina.video_playersdkv2.R;
7 |
8 | import android.content.Context;
9 | import android.content.res.TypedArray;
10 | import android.util.AttributeSet;
11 | import android.view.View;
12 | import android.widget.ImageButton;
13 |
14 | /**
15 | * 广告用的音量按钮,静音开关方式,点击后或者开启或者关闭声音
16 | *
17 | * @author sunxiao
18 | *
19 | */
20 | public final class VDVideoADSoundButton extends ImageButton implements
21 | VDBaseWidget, OnSoundChangedListener {
22 |
23 | private int mResID = -1;
24 | private int mSilentResID = -1;
25 | private Context mContext = null;
26 |
27 | public VDVideoADSoundButton(Context context) {
28 | super(context);
29 | // TODO Auto-generated constructor stub
30 | registerListeners();
31 | init(context);
32 | }
33 |
34 | public VDVideoADSoundButton(Context context, AttributeSet attrs) {
35 | super(context, attrs);
36 | // TODO Auto-generated constructor stub
37 | // 支持自定义背景
38 | TypedArray typedArr = context.obtainStyledAttributes(attrs,
39 | new int[] { android.R.attr.background });
40 | if (typedArr != null) {
41 | mResID = typedArr.getResourceId(0, -1);
42 | if (mResID == -1) {
43 | mResID = R.drawable.play_ctrl_volume;
44 | }
45 | typedArr.recycle();
46 | }
47 | // 静音部分的定义
48 | typedArr = context.obtainStyledAttributes(attrs,
49 | R.styleable.VDVideoADSoundButton);
50 | mSilentResID = R.drawable.ad_silent_selcetor;
51 | if (typedArr != null) {
52 | for (int i = 0; i < typedArr.getIndexCount(); i++) {
53 | if (typedArr.getIndex(i) == R.styleable.VDVideoADSoundButton_adSoundSeekSilent) {
54 | // 自定义背景的时候,换静音按钮
55 | mSilentResID = typedArr.getResourceId(i, -1);
56 | }
57 | }
58 | typedArr.recycle();
59 | }
60 |
61 | registerListeners();
62 | init(context);
63 | }
64 |
65 | private void init(Context context) {
66 | mContext = context;
67 | changeBackground(VDPlayerSoundManager.isMuted(context));
68 | }
69 |
70 | private void changeBackground(boolean isSilent) {
71 | if (isSilent)
72 | setBackgroundResource(mSilentResID);
73 | else
74 | setBackgroundResource(mResID);
75 | }
76 |
77 | /**
78 | * 为自己注册事件
79 | */
80 | private void registerListeners() {
81 |
82 | // click事件
83 | this.setOnClickListener(new OnClickListener() {
84 |
85 | @Override
86 | public void onClick(View v) {
87 | // 先测试添加于此
88 | boolean isMuted = VDPlayerSoundManager.isMuted(mContext);
89 | isMuted = !isMuted;
90 | VDPlayerSoundManager.setMute(mContext, isMuted, false);
91 | changeBackground(isMuted);
92 | }
93 |
94 | });
95 |
96 | }
97 |
98 | @Override
99 | public void reset() {
100 | // TODO Auto-generated method stub
101 | VDVideoViewController controller = VDVideoViewController
102 | .getInstance(this.getContext());
103 | if (null != controller)
104 | controller.addOnSoundChangedListener(this);
105 | }
106 |
107 | @Override
108 | public void hide() {
109 | // TODO Auto-generated method stub
110 | VDVideoViewController controller = VDVideoViewController
111 | .getInstance(this.getContext());
112 | if (null != controller)
113 | controller.removeOnSoundChangedListener(this);
114 | }
115 |
116 | @Override
117 | public void onSoundChanged(int currVolume) {
118 | // TODO Auto-generated method stub
119 | int currSoundNum = VDPlayerSoundManager.getCurrSoundVolume(mContext);
120 | if (currSoundNum > 0) {
121 | changeBackground(false);
122 | } else {
123 | changeBackground(true);
124 | }
125 | }
126 |
127 | }
128 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoBackButton.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets;
2 |
3 | import android.content.Context;
4 | import android.content.res.TypedArray;
5 | import android.util.AttributeSet;
6 | import android.view.View;
7 | import android.widget.ImageButton;
8 |
9 | import com.sina.sinavideo.sdk.VDVideoViewController;
10 | import com.sina.video_playersdkv2.R;
11 |
12 | /**
13 | * 返回按键,从全屏返回半屏。从横屏到竖屏部分的点击按钮显示
14 | *
15 | * @author sunxiao
16 | *
17 | */
18 | public final class VDVideoBackButton extends ImageButton implements
19 | VDBaseWidget {
20 |
21 | // private Context mContext = null;
22 | // private final static String TAG = "VDVideoBackButton";
23 |
24 | public VDVideoBackButton(Context context) {
25 | super(context);
26 | // mContext = context;
27 | registerListeners();
28 | }
29 |
30 | public VDVideoBackButton(Context context, AttributeSet attrs) {
31 | super(context, attrs);
32 | // mContext = context;
33 |
34 | // 判断是否有新定义的背景图片,没有则使用sina视频的默认图片
35 | TypedArray typedArr = context.obtainStyledAttributes(attrs,
36 | new int[] { android.R.attr.background });
37 | if (typedArr != null) {
38 | int resouceID = typedArr.getResourceId(0, -1);
39 | if (resouceID == -1) {
40 | setBackgroundResource(R.drawable.play_ctrl_back);
41 | }
42 | typedArr.recycle();
43 | } else {
44 | setBackgroundResource(R.drawable.play_ctrl_back);
45 | }
46 |
47 | registerListeners();
48 | }
49 |
50 | @Override
51 | public void reset() {
52 | }
53 |
54 | @Override
55 | public void hide() {
56 | }
57 |
58 | /**
59 | * 为自己注册事件
60 | */
61 | private void registerListeners() {
62 |
63 | // click事件
64 | this.setOnClickListener(new OnClickListener() {
65 |
66 | @Override
67 | public void onClick(View v) {
68 | VDVideoViewController controller = VDVideoViewController
69 | .getInstance(VDVideoBackButton.this.getContext());
70 | if (null != controller)
71 | controller.setIsFullScreen(false);
72 | }
73 |
74 | });
75 |
76 | }
77 |
78 | }
79 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoBottomColorBar.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets;
2 |
3 | import android.content.Context;
4 | import android.graphics.Canvas;
5 | import android.graphics.Color;
6 | import android.graphics.Paint;
7 | import android.graphics.Paint.Style;
8 | import android.graphics.Rect;
9 | import android.util.AttributeSet;
10 | import android.widget.SeekBar;
11 |
12 | import com.sina.sinavideo.sdk.VDVideoViewController;
13 | import com.sina.sinavideo.sdk.VDVideoViewListeners;
14 | import com.sina.sinavideo.sdk.data.VDVideoInfo;
15 |
16 | /**
17 | * 详情界面视频播放进度条
18 | *
19 | * @author liuqun
20 | *
21 | */
22 | public final class VDVideoBottomColorBar extends SeekBar implements
23 | VDBaseWidget, VDVideoViewListeners.OnProgressUpdateListener {
24 |
25 | private int progress = 0;
26 | private int max = 1;
27 | private Paint mPaint;
28 | private Rect r = new Rect();
29 |
30 | @Override
31 | public int getProgress() {
32 | return progress;
33 | }
34 |
35 | @Override
36 | public void setProgress(int progress) {
37 | this.progress = progress;
38 | postInvalidate();
39 | }
40 |
41 | @Override
42 | public int getMax() {
43 | return max;
44 | }
45 |
46 | @Override
47 | public void setMax(int max) {
48 | this.max = max;
49 | }
50 |
51 | public VDVideoBottomColorBar(Context context) {
52 | super(context);
53 | init();
54 | }
55 |
56 | public VDVideoBottomColorBar(Context context, AttributeSet attrs) {
57 | super(context, attrs);
58 | init();
59 | }
60 |
61 | private void init() {
62 | mPaint = new Paint();
63 | }
64 |
65 | @Override
66 | public void reset() {
67 | VDVideoViewController controller = VDVideoViewController
68 | .getInstance(this.getContext());
69 | if (controller == null) {
70 | return;
71 | }
72 | VDVideoInfo info = controller.getCurrentVideo();
73 | if (info != null) {
74 | onProgressUpdate(info.mVideoPosition, info.mVideoDuration);
75 | }
76 | controller.addOnProgressUpdateListener(this);
77 | }
78 |
79 | @Override
80 | public void hide() {
81 | VDVideoViewController ctr = VDVideoViewController.getInstance(this
82 | .getContext());
83 | if (ctr != null)
84 | ctr.removeOnProgressUpdateListener(this);
85 | }
86 |
87 | @Override
88 | protected void onDraw(Canvas canvas) {
89 | super.onDraw(canvas);
90 | if (max != 0) {
91 | int end = (int) (((float) progress * getMeasuredWidth()) / max);
92 | mPaint.setColor(Color.parseColor("#0078db"));
93 | mPaint.setStyle(Style.FILL);
94 | r.set(0, 0, end, getMeasuredHeight());
95 | canvas.drawRect(r, mPaint);
96 | }
97 | }
98 |
99 | @Override
100 | public void onProgressUpdate(long current, long duration) {
101 | setMax((int) duration);
102 | setProgress((int) current);
103 | }
104 |
105 | @Override
106 | public void onDragProgess(long progress, long duration) {
107 | onProgressUpdate(progress, duration);
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoDefinitionLayout.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets;
2 |
3 | import java.util.HashMap;
4 | import java.util.Iterator;
5 | import java.util.LinkedHashMap;
6 | import java.util.Set;
7 |
8 | import android.content.Context;
9 | import android.util.AttributeSet;
10 | import android.view.View;
11 | import android.widget.LinearLayout;
12 | import android.widget.TextView;
13 |
14 | import com.sina.sinavideo.sdk.VDVideoViewController;
15 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnVMSResolutionListener;
16 | import com.sina.sinavideo.sdk.data.VDResolutionData;
17 |
18 | /**
19 | * 清晰度选择窗口
20 | *
21 | * @deprecated 用VDVideoResolutionList代替
22 | * @author seven
23 | *
24 | */
25 | public final class VDVideoDefinitionLayout extends LinearLayout implements
26 | VDBaseWidget, OnVMSResolutionListener {
27 |
28 | private Context mContext = null;
29 |
30 | public VDVideoDefinitionLayout(Context context) {
31 | super(context);
32 | init(context, null);
33 | }
34 |
35 | public VDVideoDefinitionLayout(Context context, AttributeSet attrs) {
36 | super(context, attrs);
37 | init(context, attrs);
38 | }
39 |
40 | private void init(Context context, AttributeSet attrs) {
41 | mContext = context;
42 | setOrientation(LinearLayout.VERTICAL);
43 | registerListener();
44 | }
45 |
46 | private void registerListener() {
47 | VDVideoViewController controller = VDVideoViewController
48 | .getInstance(this.getContext());
49 | if (null != controller)
50 | controller.addOnVMSResolutionListener(this);
51 | }
52 |
53 | @Override
54 | public void reset() {
55 | }
56 |
57 | @Override
58 | public void hide() {
59 | removeAllViews();
60 | }
61 |
62 | @Override
63 | public void onVMSResolutionContainerVisible(boolean isVisible) {
64 | VDVideoViewController controller = VDVideoViewController
65 | .getInstance(this.getContext());
66 | if (controller == null)
67 | return;
68 | HashMap vmsResolutionInfo = controller
69 | .getCurrVMSResolutionInfo();
70 | if (vmsResolutionInfo != null) {
71 | removeAllViews();
72 | Set keys = vmsResolutionInfo.keySet();
73 | addItems(keys);
74 | }
75 | onSizeChanged(getWidth(), getHeight(), 0, 0);
76 | }
77 |
78 | @Override
79 | public void onVMSResolutionChanged() {
80 | onSizeChanged(getWidth(), getHeight(), 0, 0);
81 | }
82 |
83 | private void addItems(Set keys) {
84 | // LinkedHashMap desc = VDVMSVideoRequest.mDefDesc;
85 | LinkedHashMap desc = VDResolutionData.mDefDesc;
86 | for (Iterator iterator = desc.keySet().iterator(); iterator
87 | .hasNext();) {
88 | final String key = iterator.next();
89 | if (keys.contains(key)) {
90 | TextView view = new TextView(mContext);
91 | view.setText(desc.get(key));
92 | view.setTextSize(24);
93 | LayoutParams params = new LayoutParams(
94 | LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
95 | view.setPadding(0, 20, 20, 0);
96 | view.setLayoutParams(params);
97 | view.setOnClickListener(new OnClickListener() {
98 |
99 | @Override
100 | public void onClick(View v) {
101 | VDVideoViewController controller = VDVideoViewController
102 | .getInstance(VDVideoDefinitionLayout.this
103 | .getContext());
104 | if (controller == null) {
105 | return;
106 | }
107 | long sec = controller.getCurrentPosition();
108 | controller.changeResolution(sec, key);
109 | }
110 | });
111 | addView(view);
112 | }
113 | }
114 |
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoDefinitionTextView.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.content.res.TypedArray;
6 | import android.util.AttributeSet;
7 | import android.view.View;
8 | import android.widget.TextView;
9 |
10 | import com.sina.sinavideo.sdk.VDVideoViewController;
11 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnVMSResolutionListener;
12 | import com.sina.sinavideo.sdk.data.VDResolutionData;
13 | import com.sina.sinavideo.sdk.utils.VDResolutionManager;
14 | import com.sina.video_playersdkv2.R;
15 |
16 | /**
17 | * 清晰度选择按钮部分,点击打开清晰度选择窗口
18 | *
19 | * @deprecated 使用VDVideoResolutionListButton代替
20 | * @author seven
21 | */
22 | public final class VDVideoDefinitionTextView extends TextView implements
23 | VDBaseWidget, OnVMSResolutionListener {
24 |
25 | private Context mContext = null;
26 | private int mContainerID = -1;
27 |
28 | public VDVideoDefinitionTextView(Context context, AttributeSet attrs) {
29 | super(context, attrs);
30 | init(context, attrs);
31 | }
32 |
33 | private void init(Context context, AttributeSet attrs) {
34 | mContext = context;
35 |
36 | // 指定相应的音量控制容器类
37 | TypedArray typedArr = context.obtainStyledAttributes(attrs,
38 | R.styleable.VDVideoDefinitionTextView);
39 | if (typedArr != null) {
40 | for (int i = 0; i < typedArr.getIndexCount(); i++) {
41 | if (typedArr.getIndex(i) == R.styleable.VDVideoDefinitionTextView_definitionContainer) {
42 | mContainerID = typedArr.getResourceId(i, -1);
43 | }
44 | }
45 | typedArr.recycle();
46 | }
47 | updateText();
48 | registerListeners();
49 | }
50 |
51 | @Override
52 | public void reset() {
53 | updateText();
54 | }
55 |
56 | @Override
57 | public void hide() {
58 | }
59 |
60 | /**
61 | * 为自己注册事件
62 | */
63 | private void registerListeners() {
64 |
65 | // click事件
66 | this.setOnClickListener(new OnClickListener() {
67 |
68 | @Override
69 | public void onClick(View v) {
70 | if (mContainerID == -1) {
71 | return;
72 | }
73 | View container = ((Activity) mContext)
74 | .findViewById(mContainerID);
75 | if (container != null) {
76 | boolean isVisible = container.getVisibility() == View.GONE;
77 | VDVideoViewController controller = VDVideoViewController
78 | .getInstance(VDVideoDefinitionTextView.this
79 | .getContext());
80 | if (controller != null)
81 | controller.notifyDefinitionContainerVisible(isVisible);
82 | }
83 | }
84 |
85 | });
86 |
87 | }
88 |
89 | @Override
90 | public void onVMSResolutionContainerVisible(boolean isVisible) {
91 | if (isVisible) {
92 | updateText();
93 | setPressed(true);
94 | } else {
95 | setPressed(false);
96 | }
97 | }
98 |
99 | @Override
100 | public void onVMSResolutionChanged() {
101 | updateText();
102 | }
103 |
104 | /**
105 | * 更新分辨率控制区的文字显示内容
106 | */
107 | private void updateText() {
108 | VDVideoViewController controller = VDVideoViewController
109 | .getInstance(this.getContext());
110 | if (null == controller)
111 | return;
112 | VDResolutionManager resolutionManager = VDResolutionManager
113 | .getInstance(controller.getContext());
114 | if (resolutionManager != null) {
115 | String tag = resolutionManager.getCurrResolutionTag();
116 | setText(VDResolutionData.mDefDesc.get(tag));
117 | }
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoDescriptionTextView.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.TextView;
6 |
7 | import com.sina.sinavideo.sdk.VDVideoViewController;
8 | import com.sina.sinavideo.sdk.VDVideoViewListeners;
9 | import com.sina.sinavideo.sdk.data.VDVideoInfo;
10 |
11 | /**
12 | * 视频标题TextView
13 | *
14 | * @author liuqun
15 | *
16 | */
17 | public final class VDVideoDescriptionTextView extends TextView implements
18 | VDBaseWidget, VDVideoViewListeners.OnPlayVideoListener {
19 |
20 | public VDVideoDescriptionTextView(Context context) {
21 | super(context);
22 | }
23 |
24 | public VDVideoDescriptionTextView(Context context, AttributeSet attrs) {
25 | super(context, attrs);
26 | }
27 |
28 | @Override
29 | public void reset() {
30 | // TODO Auto-generated method stub
31 | VDVideoViewController controller = VDVideoViewController
32 | .getInstance(this.getContext());
33 | if (null != controller)
34 | controller.addOnPlayVideoListener(this);
35 |
36 | }
37 |
38 | @Override
39 | public void hide() {
40 | // TODO Auto-generated method stub
41 | VDVideoViewController controller = VDVideoViewController
42 | .getInstance(this.getContext());
43 | if (null != controller)
44 | controller.removeOnPlayVideoListener(this);
45 | }
46 |
47 | @Override
48 | public void onVideoInfo(VDVideoInfo info) {
49 | // TODO Auto-generated method stub
50 | setText(info.mDescription);
51 | }
52 |
53 | @Override
54 | public void onShowLoading(boolean show) {
55 | // TODO Auto-generated method stub
56 |
57 | }
58 |
59 | @Override
60 | public void onVideoPrepared(boolean prepare) {
61 | // TODO Auto-generated method stub
62 |
63 | }
64 |
65 | @Override
66 | public void onPlayStateChanged() {
67 | // TODO Auto-generated method stub
68 |
69 | }
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoDoubleTapPlayView.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.util.Log;
6 | import android.view.View;
7 | import android.view.animation.Animation;
8 | import android.view.animation.AnimationUtils;
9 | import android.widget.ImageView;
10 |
11 | import com.sina.sinavideo.sdk.VDVideoViewController;
12 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnVideoDoubleTapListener;
13 | import com.sina.video_playersdkv2.R;
14 |
15 | /**
16 | * 双击播放/暂停动画view
17 | *
18 | * @author liuqun
19 | *
20 | */
21 | public final class VDVideoDoubleTapPlayView extends ImageView implements
22 | VDBaseWidget, OnVideoDoubleTapListener {
23 |
24 | private Context mContext = null;
25 |
26 | public VDVideoDoubleTapPlayView(Context context) {
27 | super(context);
28 | mContext = context;
29 | registerListeners();
30 | }
31 |
32 | public VDVideoDoubleTapPlayView(Context context, AttributeSet attrs) {
33 | super(context, attrs);
34 | mContext = context;
35 |
36 | // 判断是否有新定义的背景图片,没有则使用sina视频的默认图片
37 | // TypedArray typedArr = context.obtainStyledAttributes(attrs,
38 | // new int[] { android.R.attr.background });
39 | // if (typedArr != null) {
40 | // int resouceID = typedArr.getResourceId(0, -1);
41 | // if (resouceID == -1) {
42 | // setBackgroundResource(R.drawable.play_ctrl_back);
43 | // }
44 | // typedArr.recycle();
45 | // } else {
46 | // setBackgroundResource(R.drawable.play_ctrl_back);
47 | // }
48 |
49 | registerListeners();
50 | }
51 |
52 | @Override
53 | public void reset() {
54 | Log.i("VDVideoDoubleTapPlayView", "reset");
55 | setVisibility(GONE);
56 | VDVideoViewController controller = VDVideoViewController
57 | .getInstance(this.getContext());
58 | if (null != controller)
59 | controller.addOnVideoDoubleTapListener(this);
60 | }
61 |
62 | @Override
63 | public void hide() {
64 | Log.i("VDVideoDoubleTapPlayView", "hide");
65 | VDVideoViewController controller = VDVideoViewController
66 | .getInstance(this.getContext());
67 | if (null != controller)
68 | controller.removeOnVideoDoubleTapListener(this);
69 | }
70 |
71 | /**
72 | * 为自己注册事件
73 | */
74 | private void registerListeners() {
75 | // VDVideoViewController.getInstance().addOnVideoDoubleTapListener(this);
76 | }
77 |
78 | @Override
79 | public void onDoubleTouch() {
80 | Log.i("VDVideoDoubleTapPlayView", "onDoubleTouch");
81 | VDVideoViewController controller = VDVideoViewController
82 | .getInstance(this.getContext());
83 | if (controller != null && controller.getIsPlaying()) {
84 | setBackgroundResource(R.drawable.play_ctrl_play);
85 | } else {
86 | setBackgroundResource(R.drawable.play_ctrl_pause);
87 | }
88 | Animation a = AnimationUtils.loadAnimation(mContext, R.anim.zoom_out);
89 |
90 | a.setAnimationListener(new Animation.AnimationListener() {
91 |
92 | @Override
93 | public void onAnimationStart(Animation animation) {
94 | // cancelHide();
95 | // sendHideDelay(sDefaultTimeout);
96 | }
97 |
98 | @Override
99 | public void onAnimationRepeat(Animation animation) {
100 |
101 | }
102 |
103 | @Override
104 | public void onAnimationEnd(Animation animation) {
105 | // animIsShowing = false;
106 | clearAnimation();
107 | setVisibility(GONE);
108 | }
109 | });
110 | setVisibility(View.VISIBLE);
111 | startAnimation(a);
112 | }
113 |
114 | }
115 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoErrorLayout.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.widget.RelativeLayout;
8 |
9 | import com.sina.sinavideo.coreplayer.splayer.MediaPlayer;
10 | import com.sina.sinavideo.coreplayer.splayer.MediaPlayer.OnVideoOpenedListener;
11 | import com.sina.sinavideo.sdk.VDVideoViewController;
12 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnClickRetryListener;
13 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnErrorListener;
14 | import com.sina.video_playersdkv2.R;
15 |
16 | /**
17 | * 播放器错误信息提醒框
18 | *
19 | * @author liuqun
20 | *
21 | */
22 | public final class VDVideoErrorLayout extends RelativeLayout implements
23 | VDBaseWidget, OnVideoOpenedListener, OnErrorListener,
24 | OnClickRetryListener {
25 |
26 | private View mBtnReplay;
27 |
28 | public VDVideoErrorLayout(Context context) {
29 | super(context);
30 | init(context);
31 | }
32 |
33 | public VDVideoErrorLayout(Context context, AttributeSet attrs) {
34 | super(context, attrs);
35 | init(context);
36 | }
37 |
38 | public VDVideoErrorLayout(Context context, AttributeSet attrs, int defStyle) {
39 | super(context, attrs, defStyle);
40 | init(context);
41 |
42 | }
43 |
44 | private void init(Context context) {
45 | View v = LayoutInflater.from(context).inflate(
46 | R.layout.video_play_error_layout, null);
47 | addView(v, new LayoutParams(-1, -1));
48 | mBtnReplay = findViewById(R.id.btn_replay);
49 | registerListener();
50 | }
51 |
52 | public void registerListener() {
53 | VDVideoViewController controller = VDVideoViewController
54 | .getInstance(this.getContext());
55 | if (controller != null)
56 | controller.addOnRetryErrorListener(this);
57 | mBtnReplay.setOnClickListener(mRetryListener);
58 | if (controller != null)
59 | controller.addOnClickRetryListener(this);
60 | }
61 |
62 | public void setValue(String value) {
63 |
64 | }
65 |
66 | @Override
67 | public void reset() {
68 | }
69 |
70 | @Override
71 | public void hide() {
72 | // VDVideoViewController.getInstance().removeOnClickRetryListener(this);
73 | }
74 |
75 | @Override
76 | public void onVideoOpened(MediaPlayer mp) {
77 | setVisibility(GONE);
78 | setValue("缓冲...");
79 | }
80 |
81 | private View.OnClickListener mRetryListener = new OnClickListener() {
82 |
83 | @Override
84 | public void onClick(View v) {
85 | VDVideoViewController controller = VDVideoViewController
86 | .getInstance(VDVideoErrorLayout.this.getContext());
87 | if (controller == null)
88 | return;
89 | controller.playVideoWithInfo(controller.getCurrentVideo());
90 | controller.notifyClickRetry();
91 | setVisibility(GONE);
92 | }
93 | };
94 |
95 | @Override
96 | public boolean onError(int what, int extra) {
97 | setVisibility(VISIBLE);
98 | return false;
99 | }
100 |
101 | @Override
102 | public void onClickRetry() {
103 | setVisibility(GONE);
104 | }
105 |
106 | }
107 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoFullScreenButton.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 全屏按钮部分,点击后,横屏显示
3 | *
4 | * @author sunxiao
5 | */
6 |
7 | package com.sina.sinavideo.sdk.widgets;
8 |
9 | import android.content.Context;
10 | import android.content.res.TypedArray;
11 | import android.util.AttributeSet;
12 | import android.view.View;
13 | import android.widget.ImageButton;
14 |
15 | import com.sina.sinavideo.sdk.VDVideoViewController;
16 | import com.sina.sinavideo.sdk.utils.VDVideoFullModeController;
17 | import com.sina.video_playersdkv2.R;
18 |
19 | public final class VDVideoFullScreenButton extends ImageButton implements
20 | VDBaseWidget {
21 |
22 | public VDVideoFullScreenButton(Context context) {
23 | super(context);
24 | init();
25 | }
26 |
27 | public VDVideoFullScreenButton(Context context, AttributeSet attrs) {
28 | super(context, attrs);
29 |
30 | // 判断是否有新定义的背景图片,没有则使用sina视频的默认图片
31 | TypedArray typedArr = context.obtainStyledAttributes(attrs,
32 | new int[] { android.R.attr.background });
33 | if (typedArr != null) {
34 | int resouceID = typedArr.getResourceId(0, -1);
35 | if (resouceID == -1) {
36 | setBackgroundResource(R.drawable.play_ctrl_fullscreen);
37 | }
38 | typedArr.recycle();
39 | } else {
40 | setBackgroundResource(R.drawable.play_ctrl_fullscreen);
41 | }
42 |
43 | init();
44 | }
45 |
46 | private void init() {
47 | registerListeners();
48 | }
49 |
50 | private void registerListeners() {
51 | setOnClickListener(new View.OnClickListener() {
52 |
53 | @Override
54 | public void onClick(View v) {
55 | if (!VDVideoFullModeController.getInstance().getIsFullScreen()) {
56 | VDVideoViewController controller = VDVideoViewController
57 | .getInstance(VDVideoFullScreenButton.this
58 | .getContext());
59 | if (null != controller)
60 | controller.setIsFullScreen(true);
61 | }
62 | }
63 | });
64 | }
65 |
66 | @Override
67 | public void reset() {
68 | }
69 |
70 | @Override
71 | public void hide() {
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoIndicaterLayout.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.util.Log;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.RelativeLayout;
10 |
11 | import com.sina.sinavideo.coreplayer.ISinaVideoView;
12 | import com.sina.sinavideo.sdk.VDVideoViewController;
13 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnScreenOrientationSwitchListener;
14 | import com.sina.sinavideo.sdk.data.VDVideoInfo;
15 | import com.sina.sinavideo.sdk.utils.VDSharedPreferencesUtil;
16 | import com.sina.video_playersdkv2.R;
17 |
18 | /**
19 | * 播放器错误信息提醒框
20 | *
21 | * @author liuqun
22 | *
23 | */
24 | public final class VDVideoIndicaterLayout extends RelativeLayout implements
25 | VDBaseWidget, OnScreenOrientationSwitchListener {
26 |
27 | private Context mContext = null;
28 |
29 | public VDVideoIndicaterLayout(Context context) {
30 | super(context);
31 | init(context);
32 | }
33 |
34 | public VDVideoIndicaterLayout(Context context, AttributeSet attrs) {
35 | super(context, attrs);
36 | init(context);
37 | }
38 |
39 | public VDVideoIndicaterLayout(Context context, AttributeSet attrs,
40 | int defStyle) {
41 | super(context, attrs, defStyle);
42 | init(context);
43 |
44 | }
45 |
46 | private void init(Context context) {
47 | mContext = context;
48 | ViewGroup group = null;
49 | View v = LayoutInflater.from(context).inflate(
50 | R.layout.indicater_layer_include, group);
51 | addView(v);
52 | registerListener();
53 | }
54 |
55 | public void registerListener() {
56 | VDVideoViewController controller = VDVideoViewController
57 | .getInstance(this.getContext());
58 | if (controller != null)
59 | controller.addOnScreenOrientationSwitchListener(this);
60 | setOnClickListener(mCloseListener);
61 | }
62 |
63 | private View.OnClickListener mCloseListener = new View.OnClickListener() {
64 |
65 | @Override
66 | public void onClick(View v) {
67 | setVisibility(GONE);
68 | VDVideoViewController controller = VDVideoViewController
69 | .getInstance(VDVideoIndicaterLayout.this.getContext());
70 | if (controller == null)
71 | return;
72 | ISinaVideoView videoViewe = controller.getVideoView();
73 | if (videoViewe != null && !videoViewe.isPlaying()) {
74 | videoViewe.start();
75 | }
76 | }
77 | };
78 |
79 | @Override
80 | public void reset() {
81 |
82 | }
83 |
84 | @Override
85 | public void hide() {
86 | }
87 |
88 | @Override
89 | public void onScreenOrientationSwitch(boolean fullScreen) {
90 | Log.i("VDVideoIndicaterLayout",
91 | "onScreenOrientationSwitch --> fullScreen = " + fullScreen);
92 | if (fullScreen) {
93 | boolean first_full = VDSharedPreferencesUtil
94 | .isFirstFullScreen(mContext);
95 | Log.i("VDVideoIndicaterLayout",
96 | "onScreenOrientationSwitch --> fullScreen = " + fullScreen
97 | + " , first_full = " + first_full);
98 | VDVideoViewController contorlloer = VDVideoViewController
99 | .getInstance(this.getContext());
100 | if (contorlloer == null) {
101 | return;
102 | }
103 | VDVideoInfo mVideoInfo = contorlloer.getCurrentVideo();
104 | if (first_full && mVideoInfo != null && !mVideoInfo.mIsLive) {
105 | setVisibility(VISIBLE);
106 | ISinaVideoView videoViewe = contorlloer.getVideoView();
107 | if (videoViewe != null && videoViewe.isPlaying()) {
108 | videoViewe.pause();
109 | }
110 | VDSharedPreferencesUtil.setFirstFullScreen(mContext, false);
111 | }
112 | } else {
113 | if (getVisibility() == VISIBLE) {
114 | setVisibility(GONE);
115 | }
116 | }
117 |
118 | }
119 |
120 | }
121 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoLastTimeTextView.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 播放时间
3 | *
4 | * @author liuqun
5 | */
6 | package com.sina.sinavideo.sdk.widgets;
7 |
8 | import android.content.Context;
9 | import android.content.res.TypedArray;
10 | import android.graphics.Color;
11 | import android.util.AttributeSet;
12 | import android.widget.TextView;
13 |
14 | import com.sina.sinavideo.sdk.VDVideoViewController;
15 | import com.sina.sinavideo.sdk.VDVideoViewListeners;
16 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnShowHideControllerListener;
17 | import com.sina.sinavideo.sdk.data.VDVideoInfo;
18 | import com.sina.sinavideo.sdk.utils.VDUtility;
19 |
20 | public final class VDVideoLastTimeTextView extends TextView implements
21 | VDBaseWidget, VDVideoViewListeners.OnProgressUpdateListener,
22 | OnShowHideControllerListener {
23 |
24 | public VDVideoLastTimeTextView(Context context) {
25 | super(context);
26 | setTextColor(Color.WHITE);
27 | }
28 |
29 | public VDVideoLastTimeTextView(Context context, AttributeSet attrs) {
30 | super(context, attrs);
31 |
32 | // 读取颜色属性,如果已经设置就使用系统的,否则用默认的
33 | TypedArray typedArr = context.obtainStyledAttributes(attrs,
34 | new int[] { android.R.attr.textColor });
35 |
36 | if (typedArr != null) {
37 | int resouceID = typedArr.getResourceId(0, -1);
38 | if (resouceID == -1) {
39 | setTextColor(Color.WHITE);
40 | }
41 | typedArr.recycle();
42 | } else {
43 | setTextColor(Color.WHITE);
44 | }
45 | VDVideoViewController controller = VDVideoViewController
46 | .getInstance(this.getContext());
47 | if (controller != null)
48 | controller.addOnShowHideControllerListener(this);
49 | }
50 |
51 | @Override
52 | public void onProgressUpdate(long current, long duration) {
53 | if (current > duration) {
54 | current = duration;
55 | }
56 | setText(VDUtility.generatePlayTime(duration - current));
57 | }
58 |
59 | @Override
60 | public void reset() {
61 | VDVideoViewController controller = VDVideoViewController
62 | .getInstance(this.getContext());
63 | if (controller == null)
64 | return;
65 | VDVideoInfo info = controller.getCurrentVideo();
66 | if (info != null) {
67 | onProgressUpdate(info.mVideoPosition, info.mVideoDuration);
68 | }
69 | controller.addOnProgressUpdateListener(this);
70 | }
71 |
72 | @Override
73 | public void hide() {
74 | VDVideoViewController controller = VDVideoViewController
75 | .getInstance(this.getContext());
76 | if (controller != null)
77 | controller.removeOnProgressUpdateListener(this);
78 | }
79 |
80 | @Override
81 | public void onDragProgess(long progress, long duration) {
82 | onProgressUpdate(progress, duration);
83 | }
84 |
85 | @Override
86 | public void doNotHideControllerBar() {
87 | // TODO Auto-generated method stub
88 |
89 | }
90 |
91 | @Override
92 | public void hideControllerBar(long delay) {
93 | // TODO Auto-generated method stub
94 |
95 | }
96 |
97 | @Override
98 | public void showControllerBar(boolean delayHide) {
99 |
100 | }
101 |
102 | @Override
103 | public void onPostHide() {
104 | setVisibility(VISIBLE);
105 | }
106 |
107 | @Override
108 | public void onPostShow() {
109 | setVisibility(GONE);
110 | }
111 |
112 | @Override
113 | public void onPreHide() {
114 |
115 | }
116 |
117 | @Override
118 | public void onPreShow() {
119 | setVisibility(GONE);
120 | }
121 |
122 | }
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoLightingPercentView.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 百分比方式显示亮度
3 | *
4 | * @author seven
5 | */
6 | package com.sina.sinavideo.sdk.widgets;
7 |
8 | import android.content.Context;
9 | import android.content.res.TypedArray;
10 | import android.graphics.Color;
11 | import android.util.AttributeSet;
12 | import android.widget.TextView;
13 |
14 | import com.sina.sinavideo.sdk.VDVideoViewController;
15 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnLightingChangeListener;
16 | import com.sina.sinavideo.sdk.utils.VDLog;
17 |
18 | public final class VDVideoLightingPercentView extends TextView implements
19 | VDBaseWidget, OnLightingChangeListener {
20 |
21 | public VDVideoLightingPercentView(Context context, AttributeSet attrs) {
22 | super(context, attrs);
23 |
24 | TypedArray typedArr = context.obtainStyledAttributes(attrs, new int[] {
25 | android.R.attr.textSize, android.R.attr.textColor });
26 | if (typedArr != null) {
27 | float textSize = typedArr.getDimension(0, -1);
28 | if (textSize == -1) {
29 | setTextSize(20);
30 | }
31 |
32 | int textColor = typedArr.getColor(1, -1);
33 | if (textColor == -1) {
34 | setTextColor(Color.WHITE);
35 | }
36 | typedArr.recycle();
37 | }
38 |
39 | getPaint().setFakeBoldText(true);
40 |
41 | }
42 |
43 | @Override
44 | public void reset() {
45 | // TODO Auto-generated method stub
46 | VDVideoViewController controller = VDVideoViewController
47 | .getInstance(this.getContext());
48 | if (controller == null)
49 | return;
50 | controller.addOnLightingChangeListener(this);
51 | setLigtingText(controller.getCurrLightingSetting());
52 | }
53 |
54 | @Override
55 | public void hide() {
56 | // TODO Auto-generated method stub
57 | VDVideoViewController controller = VDVideoViewController
58 | .getInstance(this.getContext());
59 | if (controller != null)
60 | controller.removeOnLightingChangeListener(this);
61 | }
62 |
63 | @Override
64 | public void onLightingChange(float curr) {
65 | // TODO Auto-generated method stub
66 | setLigtingText(curr);
67 | }
68 |
69 | private void setLigtingText(float curr) {
70 | VDLog.e("TAG", "curr:" + curr);
71 | setText(String.format("%.0f%%", curr * 100));
72 | }
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoLoadingPercentView.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets;
2 |
3 | import com.sina.sinavideo.sdk.VDVideoViewController;
4 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnBufferingUpdateListener;
5 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnLoadingListener;
6 | import com.sina.sinavideo.sdk.utils.VDLog;
7 | import com.sina.video_playersdkv2.R;
8 |
9 | import android.content.Context;
10 | import android.content.res.TypedArray;
11 | import android.util.AttributeSet;
12 | import android.view.View;
13 | import android.widget.TextView;
14 |
15 | public final class VDVideoLoadingPercentView extends TextView implements
16 | VDBaseWidget, OnLoadingListener, OnBufferingUpdateListener {
17 |
18 | private String mLoadingText = "正在缓冲%d%%";
19 | private String mPreLoadingText = "开始加载";
20 | private Context mContext = null;
21 | private boolean mIsVisible = false;
22 |
23 | public VDVideoLoadingPercentView(Context context) {
24 | super(context);
25 | // TODO Auto-generated constructor stub
26 | init(context);
27 | }
28 |
29 | public VDVideoLoadingPercentView(Context context, AttributeSet attrs) {
30 | super(context, attrs);
31 | // TODO Auto-generated constructor stub
32 | TypedArray typedArr = context.obtainStyledAttributes(attrs,
33 | R.styleable.VDVideoLoadingPercentView);
34 | if (typedArr != null) {
35 | for (int i = 0; i < typedArr.getIndexCount(); i++) {
36 | if (typedArr.getIndex(i) == R.styleable.VDVideoLoadingPercentView_loadingText) {
37 | mLoadingText = typedArr
38 | .getString(R.styleable.VDVideoLoadingPercentView_loadingText);
39 | } else if (typedArr.getIndex(i) == R.styleable.VDVideoLoadingPercentView_preLoadingText) {
40 | mPreLoadingText = typedArr
41 | .getString(R.styleable.VDVideoLoadingPercentView_preLoadingText);
42 | }
43 | }
44 | typedArr.recycle();
45 | }
46 | init(context);
47 | }
48 |
49 | private void init(Context context) {
50 | mContext = context;
51 | registerListener();
52 | }
53 |
54 | private void registerListener() {
55 | VDVideoViewController controller = VDVideoViewController
56 | .getInstance(mContext);
57 | if (controller != null) {
58 | controller.addOnBufferingUpdateListener(this);
59 | controller.addOnLoadingListener(this);
60 | }
61 | }
62 |
63 | @Override
64 | public void reset() {
65 | // TODO Auto-generated method stub
66 | registerListener();
67 | }
68 |
69 | @Override
70 | public void hide() {
71 | // TODO Auto-generated method stub
72 | }
73 |
74 | @Override
75 | public void showLoading() {
76 | // TODO Auto-generated method stub
77 | setText(mPreLoadingText);
78 | setVisibility(View.VISIBLE);
79 | mIsVisible = true;
80 | }
81 |
82 | @Override
83 | public void hideLoading() {
84 | // TODO Auto-generated method stub
85 | setVisibility(View.GONE);
86 | mIsVisible = false;
87 | }
88 |
89 | @Override
90 | public void onBufferingUpdate(int percent) {
91 | // TODO Auto-generated method stub
92 | if (mIsVisible) {
93 | try {
94 | String formatTxt = String.format(mLoadingText, percent);
95 | setText(formatTxt);
96 | } catch (Exception ex) {
97 | VDLog.e(VIEW_LOG_TAG, ex.getMessage());
98 | ex.printStackTrace();
99 | }
100 | }
101 | }
102 |
103 | }
104 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoLoadingProgress.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.ProgressBar;
6 |
7 | import com.sina.sinavideo.sdk.VDVideoViewController;
8 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnLoadingListener;
9 |
10 | /**
11 | * 中间加载进度条
12 | *
13 | * @author liuqun
14 | *
15 | */
16 | public final class VDVideoLoadingProgress extends ProgressBar implements
17 | VDBaseWidget, OnLoadingListener {
18 |
19 | public VDVideoLoadingProgress(Context context) {
20 | super(context);
21 | init();
22 | }
23 |
24 | public VDVideoLoadingProgress(Context context, AttributeSet attrs) {
25 | super(context, attrs);
26 | init();
27 | }
28 |
29 | public VDVideoLoadingProgress(Context context, AttributeSet attrs,
30 | int defStyle) {
31 | super(context, attrs, defStyle);
32 | init();
33 | }
34 |
35 | private void init() {
36 | registerListeners();
37 | }
38 |
39 | @Override
40 | public void reset() {
41 | }
42 |
43 | @Override
44 | public void hide() {
45 | }
46 |
47 | /**
48 | * 为自己注册事件
49 | */
50 | private void registerListeners() {
51 | VDVideoViewController controller = VDVideoViewController
52 | .getInstance(this.getContext());
53 | if (controller != null)
54 | controller.addOnLoadingListener(this);
55 | }
56 |
57 | @Override
58 | public void showLoading() {
59 | setVisibility(VISIBLE);
60 | }
61 |
62 | @Override
63 | public void hideLoading() {
64 | setVisibility(GONE);
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoMoreOprationButton.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Context;
5 | import android.content.res.TypedArray;
6 | import android.util.AttributeSet;
7 | import android.view.View;
8 | import android.widget.ImageButton;
9 |
10 | import com.sina.sinavideo.sdk.VDVideoViewController;
11 | import com.sina.sinavideo.sdk.widgets.VDBaseWidget;
12 | import com.sina.video_playersdkv2.R;
13 |
14 | /**
15 | * 更多按钮
16 | *
17 | * @author liuqun
18 | *
19 | */
20 | public final class VDVideoMoreOprationButton extends ImageButton implements
21 | VDBaseWidget {
22 |
23 | @SuppressLint("nouse")
24 | private final static String TAG = "VDVideoRelatedButton";
25 | @SuppressLint("nouse")
26 | private Context mContext;
27 |
28 | public VDVideoMoreOprationButton(Context context, AttributeSet attrs) {
29 | super(context, attrs);
30 | mContext = context;
31 | TypedArray typedArr = context.obtainStyledAttributes(attrs,
32 | new int[] { android.R.attr.background });
33 | if (typedArr != null) {
34 | int resouceID = typedArr.getResourceId(0, -1);
35 | if (resouceID == -1) {
36 | setBackgroundResource(R.drawable.more);
37 | }
38 | typedArr.recycle();
39 | } else {
40 | setBackgroundResource(R.drawable.more);
41 | }
42 |
43 | registerListeners();
44 | }
45 |
46 | public VDVideoMoreOprationButton(Context context) {
47 | super(context);
48 | mContext = context;
49 | registerListeners();
50 | }
51 |
52 | /**
53 | * 为自己注册事件
54 | */
55 | private void registerListeners() {
56 | // click事件
57 | this.setOnClickListener(new OnClickListener() {
58 |
59 | @Override
60 | public void onClick(View v) {
61 | VDVideoViewController controller = VDVideoViewController
62 | .getInstance(VDVideoMoreOprationButton.this
63 | .getContext());
64 | if (controller != null)
65 | controller.notifyHideControllerBar(0);
66 | if (controller != null)
67 | controller.notifyShowMoreOprationPanel();
68 | }
69 |
70 | });
71 |
72 | }
73 |
74 | @Override
75 | public void reset() {
76 |
77 | }
78 |
79 | @Override
80 | public void hide() {
81 | }
82 |
83 | }
84 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoProgressIndicaterView.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets;
2 |
3 | import android.content.Context;
4 | import android.content.res.TypedArray;
5 | import android.util.AttributeSet;
6 | import android.widget.ImageButton;
7 |
8 | import com.sina.sinavideo.sdk.VDVideoViewController;
9 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnProgressUpdateListener;
10 | import com.sina.video_playersdkv2.R;
11 |
12 | /**
13 | * 快进或快退图标
14 | *
15 | * @author liuqun
16 | */
17 | public final class VDVideoProgressIndicaterView extends ImageButton implements
18 | VDBaseWidget, OnProgressUpdateListener {
19 |
20 | // private Context mContext;
21 | private long mPosition = 0;
22 |
23 | public VDVideoProgressIndicaterView(Context context) {
24 | super(context);
25 | // mContext = context;
26 | setBackgroundResource(R.drawable.playbutton);
27 | }
28 |
29 | public VDVideoProgressIndicaterView(Context context, AttributeSet attrs) {
30 | super(context, attrs);
31 | // mContext = context;
32 |
33 | TypedArray typedArr = context.obtainStyledAttributes(attrs,
34 | new int[] { android.R.attr.background });
35 |
36 | if (typedArr != null) {
37 | int resouceID = typedArr.getResourceId(0, -1);
38 | if (resouceID == -1) {
39 | setBackgroundResource(R.drawable.playbutton);
40 | }
41 | typedArr.recycle();
42 | } else {
43 | setBackgroundResource(R.drawable.playbutton);
44 | }
45 | VDVideoViewController controller = VDVideoViewController
46 | .getInstance(context);
47 | if (controller != null)
48 | controller.addOnProgressUpdateListener(this);
49 | }
50 |
51 | @Override
52 | public void reset() {
53 | VDVideoViewController controller = VDVideoViewController
54 | .getInstance(this.getContext());
55 | if (controller != null)
56 | controller.addOnProgressUpdateListener(this);
57 | }
58 |
59 | @Override
60 | public void hide() {
61 | VDVideoViewController controller = VDVideoViewController
62 | .getInstance(this.getContext());
63 | if (controller != null)
64 | controller.removeOnProgressUpdateListener(this);
65 | }
66 |
67 | @Override
68 | public void onProgressUpdate(long current, long duration) {
69 | // TODO Auto-generated method stub
70 |
71 | }
72 |
73 | @Override
74 | public void onDragProgess(long progress, long duration) {
75 | if (mPosition < progress) {
76 | setBackgroundResource(R.drawable.play_ctrl_seek_forward);
77 | // setBackgroundResource(R.drawable.play_ctrl_seek_forward);
78 | } else {
79 | // setBackgroundResource(R.drawable.play_ctrl_seek_backward);
80 | setBackgroundResource(R.drawable.play_ctrl_seek_backward);
81 | }
82 | mPosition = progress;
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoSoundSeekImageView.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 音量控制,小喇叭标志,在静音状态会显示不同的图标
3 | *
4 | * @author seven
5 | */
6 | package com.sina.sinavideo.sdk.widgets;
7 |
8 | import android.content.Context;
9 | import android.content.res.TypedArray;
10 | import android.graphics.drawable.Drawable;
11 | import android.util.AttributeSet;
12 | import android.widget.ImageView;
13 |
14 | import com.sina.sinavideo.sdk.VDVideoViewController;
15 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnSoundChangedListener;
16 | import com.sina.video_playersdkv2.R;
17 |
18 | public final class VDVideoSoundSeekImageView extends ImageView implements
19 | VDBaseWidget, OnSoundChangedListener {
20 |
21 | private Drawable mMuteDrawable = null;
22 | private Drawable mSrcDrawable = null;
23 |
24 | public VDVideoSoundSeekImageView(Context context, AttributeSet attrs) {
25 | super(context, attrs);
26 | // TODO Auto-generated constructor stub
27 | TypedArray typedArr = context.obtainStyledAttributes(attrs,
28 | R.styleable.VDVideoSoundSeekImageView);
29 | if (typedArr != null) {
30 | for (int i = 0; i < typedArr.getIndexCount(); i++) {
31 | if (typedArr.getIndex(i) == R.styleable.VDVideoSoundSeekImageView_muteSrc) {
32 | mMuteDrawable = typedArr.getDrawable(i);
33 | if (mMuteDrawable == null) {
34 | mMuteDrawable = context.getResources().getDrawable(
35 | R.drawable.play_ctrl_sound_gestrue_silent);
36 | }
37 | }
38 | }
39 | if (mMuteDrawable == null) {
40 | mMuteDrawable = context.getResources().getDrawable(
41 | R.drawable.play_ctrl_sound_gestrue_silent);
42 | }
43 | typedArr.recycle();
44 | }
45 |
46 | typedArr = context.obtainStyledAttributes(attrs,
47 | new int[] { android.R.attr.src });
48 | if (typedArr != null) {
49 | mSrcDrawable = typedArr.getDrawable(0);
50 | if (mSrcDrawable == null) {
51 | mSrcDrawable = context.getResources().getDrawable(
52 | R.drawable.play_ctrl_sound_gestrue);
53 | }
54 | typedArr.recycle();
55 | }
56 | }
57 |
58 | @Override
59 | public void onSoundChanged(int currVolume) {
60 | // TODO Auto-generated method stub
61 | if (currVolume <= 0) {
62 | setImageDrawable(mMuteDrawable);
63 | } else {
64 | setImageDrawable(mSrcDrawable);
65 | }
66 | }
67 |
68 | @Override
69 | public void reset() {
70 | // TODO Auto-generated method stub
71 | VDVideoViewController controller = VDVideoViewController
72 | .getInstance(this.getContext());
73 | if (null != controller)
74 | controller.addOnSoundChangedListener(this);
75 | }
76 |
77 | @Override
78 | public void hide() {
79 | // TODO Auto-generated method stub
80 | VDVideoViewController controller = VDVideoViewController
81 | .getInstance(this.getContext());
82 | if (null != controller)
83 | controller.addOnSoundChangedListener(this);
84 | }
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoSoundSeekPercentView.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 音量控制组件的百分比方式显示
3 | *
4 | * @author seven
5 | */
6 | package com.sina.sinavideo.sdk.widgets;
7 |
8 | import android.content.Context;
9 | import android.content.res.TypedArray;
10 | import android.graphics.Color;
11 | import android.util.AttributeSet;
12 | import android.widget.TextView;
13 |
14 | import com.sina.sinavideo.sdk.VDVideoViewController;
15 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnSoundChangedListener;
16 | import com.sina.sinavideo.sdk.dlna.DLNAController;
17 | import com.sina.sinavideo.sdk.utils.VDPlayerSoundManager;
18 |
19 | public final class VDVideoSoundSeekPercentView extends TextView implements
20 | VDBaseWidget, OnSoundChangedListener {
21 |
22 | private Context mContext = null;
23 |
24 | public VDVideoSoundSeekPercentView(Context context, AttributeSet attrs) {
25 | super(context, attrs);
26 | // TODO Auto-generated constructor stub
27 | mContext = context;
28 | TypedArray typedArr = context.obtainStyledAttributes(attrs, new int[] {
29 | android.R.attr.textSize, android.R.attr.textColor });
30 | if (typedArr != null) {
31 | float textSize = typedArr.getDimension(0, -1);
32 | if (textSize == -1) {
33 | setTextSize(20);
34 | }
35 |
36 | int textColor = typedArr.getColor(1, -1);
37 | if (textColor == -1) {
38 | setTextColor(Color.WHITE);
39 | }
40 | typedArr.recycle();
41 | }
42 |
43 | getPaint().setFakeBoldText(true);
44 | }
45 |
46 | @Override
47 | public void reset() {
48 | // TODO Auto-generated method stub
49 | VDVideoViewController controller = VDVideoViewController
50 | .getInstance(this.getContext());
51 | if (controller != null)
52 | controller.addOnSoundChangedListener(this);
53 | float currPercent = ((float) VDPlayerSoundManager
54 | .getCurrSoundVolume(mContext) / VDPlayerSoundManager
55 | .getMaxSoundVolume(mContext));
56 | setSoundText(currPercent);
57 | }
58 |
59 | @Override
60 | public void hide() {
61 | // TODO Auto-generated method stub
62 | VDVideoViewController controller = VDVideoViewController
63 | .getInstance(this.getContext());
64 | if (controller != null)
65 | controller.removeOnSoundChangedListener(this);
66 | }
67 |
68 | @Override
69 | public void onSoundChanged(int currVolume) {
70 | int maxVolume = 0;
71 | if (DLNAController.mIsDLNA) {
72 | VDVideoViewController controller = VDVideoViewController
73 | .getInstance(this.getContext());
74 | if (controller != null)
75 | maxVolume = DLNAController.getInstance(controller.getContext())
76 | .getVolumeMax();
77 | } else {
78 | maxVolume = VDPlayerSoundManager.getMaxSoundVolume(mContext);
79 | }
80 | if (maxVolume != 0) {
81 | float currPercent = (float) currVolume / maxVolume;
82 | setSoundText(currPercent);
83 | }
84 | }
85 |
86 | private void setSoundText(float currPercent) {
87 | if (currPercent > 100) {
88 | currPercent = 100;
89 | }
90 | setText(String.format("%.0f%%", currPercent * 100));
91 | }
92 |
93 | }
94 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoTimeTextView.java:
--------------------------------------------------------------------------------
1 | /**
2 | * 播放时间
3 | *
4 | * @author liuqun
5 | */
6 | package com.sina.sinavideo.sdk.widgets;
7 |
8 | import android.content.Context;
9 | import android.content.res.TypedArray;
10 | import android.graphics.Color;
11 | import android.util.AttributeSet;
12 | import android.widget.TextView;
13 |
14 | import com.sina.sinavideo.sdk.VDVideoViewController;
15 | import com.sina.sinavideo.sdk.VDVideoViewListeners;
16 | import com.sina.sinavideo.sdk.data.VDVideoInfo;
17 | import com.sina.sinavideo.sdk.utils.VDUtility;
18 | import com.sina.video_playersdkv2.R;
19 |
20 | public final class VDVideoTimeTextView extends TextView implements
21 | VDBaseWidget, VDVideoViewListeners.OnProgressUpdateListener {
22 |
23 | public static final int TIME_FORMAT_PROGRESSDURAION = 0;
24 | public static final int TIME_FORMAT_PROGRESSONLY = 1;
25 | public static final int TIME_FORMAT_CUTDOWNPROGRESS = 2;
26 | public static final int TIME_FORMAT_DURAIONONLY = 3;
27 |
28 | private int mTimeFormat = TIME_FORMAT_PROGRESSDURAION;
29 |
30 | public VDVideoTimeTextView(Context context) {
31 | super(context);
32 | setTextColor(Color.WHITE);
33 | }
34 |
35 | public VDVideoTimeTextView(Context context, AttributeSet attrs) {
36 | super(context, attrs);
37 |
38 | // 读取颜色属性,如果已经设置就使用系统的,否则用默认的
39 | TypedArray typedArr = context.obtainStyledAttributes(attrs,
40 | new int[] { android.R.attr.textColor });
41 |
42 | if (typedArr != null) {
43 | int resouceID = typedArr.getResourceId(0, -1);
44 | if (resouceID == -1) {
45 | setTextColor(Color.WHITE);
46 | }
47 | typedArr.recycle();
48 | } else {
49 | setTextColor(Color.WHITE);
50 | }
51 |
52 | // 读取事件的显示格式
53 | TypedArray a = context.obtainStyledAttributes(attrs,
54 | R.styleable.TimeTextView);
55 | mTimeFormat = a.getInteger(R.styleable.TimeTextView_TimeFormat,
56 | TIME_FORMAT_PROGRESSDURAION);
57 | a.recycle();
58 | }
59 |
60 | @Override
61 | public void onProgressUpdate(long current, long duration) {
62 | if (current > duration) {
63 | current = duration;
64 | }
65 | switch (mTimeFormat) {
66 | case TIME_FORMAT_PROGRESSDURAION:
67 | setText(VDUtility.generatePlayTime(current) + "/"
68 | + VDUtility.generatePlayTime(duration));
69 | break;
70 | case TIME_FORMAT_PROGRESSONLY:
71 | setText(VDUtility.generatePlayTime(current));
72 | break;
73 | case TIME_FORMAT_CUTDOWNPROGRESS:
74 | setText(VDUtility.generatePlayTime(duration - current));
75 | break;
76 | case TIME_FORMAT_DURAIONONLY:
77 | setText(VDUtility.generatePlayTime(duration));
78 | break;
79 | }
80 | }
81 |
82 | @Override
83 | public void reset() {
84 | VDVideoViewController controller = VDVideoViewController
85 | .getInstance(this.getContext());
86 | if (controller == null)
87 | return;
88 | VDVideoInfo info = controller.getCurrentVideo();
89 | if (info != null) {
90 | onProgressUpdate(info.mVideoPosition, info.mVideoDuration);
91 | }
92 | controller.addOnProgressUpdateListener(this);
93 | }
94 |
95 | @Override
96 | public void hide() {
97 | VDVideoViewController controller = VDVideoViewController
98 | .getInstance(this.getContext());
99 | if (controller != null)
100 | controller.removeOnProgressUpdateListener(this);
101 | }
102 |
103 | @Override
104 | public void onDragProgess(long progress, long duration) {
105 | onProgressUpdate(progress, duration);
106 | }
107 | }
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoTipLayout.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.widget.ImageButton;
8 | import android.widget.RelativeLayout;
9 | import android.widget.TextView;
10 |
11 | import com.sina.sinavideo.coreplayer.splayer.MediaPlayer;
12 | import com.sina.sinavideo.coreplayer.splayer.MediaPlayer.OnVideoOpenedListener;
13 | import com.sina.sinavideo.sdk.VDVideoViewController;
14 | import com.sina.sinavideo.sdk.VDVideoViewListeners.OnTipListener;
15 | import com.sina.video_playersdkv2.R;
16 |
17 | /**
18 | * 播放器错误信息提醒框
19 | *
20 | * @author liuqun
21 | *
22 | */
23 | public final class VDVideoTipLayout extends RelativeLayout implements
24 | VDBaseWidget, OnVideoOpenedListener, OnTipListener {
25 |
26 | private TextView mTipMessage;
27 | private ImageButton mBtnCloseTip;
28 |
29 | public VDVideoTipLayout(Context context) {
30 | super(context);
31 | init(context);
32 | }
33 |
34 | public VDVideoTipLayout(Context context, AttributeSet attrs) {
35 | super(context, attrs);
36 | init(context);
37 | }
38 |
39 | public VDVideoTipLayout(Context context, AttributeSet attrs, int defStyle) {
40 | super(context, attrs, defStyle);
41 | init(context);
42 |
43 | }
44 |
45 | private void init(Context context) {
46 | View v = LayoutInflater.from(context)
47 | .inflate(R.layout.tip_layout, null);
48 | addView(v);
49 | mTipMessage = (TextView) findViewById(R.id.tipMessage);
50 | mBtnCloseTip = (ImageButton) findViewById(R.id.btnCloseTip);
51 | registerListener();
52 | // postDelayed(new Runnable() {
53 | //
54 | // @Override
55 | // public void run() {
56 | // onTip("测试");
57 | // }
58 | // }, 5000);
59 | }
60 |
61 | public void registerListener() {
62 | VDVideoViewController controller = VDVideoViewController
63 | .getInstance(this.getContext());
64 | if (controller != null)
65 | controller.addOnTipListener(this);
66 | mBtnCloseTip.setOnClickListener(mCloseListener);
67 | mTipMessage.setOnClickListener(mCloseListener);
68 | setOnClickListener(mCloseListener);
69 | }
70 |
71 | private View.OnClickListener mCloseListener = new View.OnClickListener() {
72 |
73 | @Override
74 | public void onClick(View v) {
75 | setVisibility(GONE);
76 | VDVideoViewController controller = VDVideoViewController
77 | .getInstance(VDVideoTipLayout.this.getContext());
78 | if (controller != null)
79 | controller.notifyHideTip();
80 | }
81 | };
82 |
83 | @Override
84 | public void reset() {
85 |
86 | }
87 |
88 | @Override
89 | public void hide() {
90 | mTipMessage.setText("");
91 | setVisibility(GONE);
92 | }
93 |
94 | @Override
95 | public void onVideoOpened(MediaPlayer mp) {
96 | // setValue("缓冲...");
97 | }
98 |
99 | @Override
100 | public void onTip(String tip) {
101 | mTipMessage.setText(tip);
102 | setVisibility(VISIBLE);
103 | }
104 |
105 | @Override
106 | public void onTip(int tipResId) {
107 | mTipMessage.setText(tipResId);
108 | setVisibility(VISIBLE);
109 | }
110 |
111 | @Override
112 | public void hideTip() {
113 | mTipMessage.setText("");
114 | setVisibility(GONE);
115 | }
116 |
117 | }
118 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/VDVideoTitleTextView.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.TextView;
6 |
7 | import com.sina.sinavideo.sdk.VDVideoViewController;
8 | import com.sina.sinavideo.sdk.VDVideoViewListeners;
9 | import com.sina.sinavideo.sdk.data.VDVideoInfo;
10 |
11 | /**
12 | * 视频标题TextView
13 | *
14 | * @author liuqun
15 | *
16 | */
17 | public final class VDVideoTitleTextView extends TextView implements
18 | VDBaseWidget, VDVideoViewListeners.OnPlayVideoListener {
19 |
20 | public VDVideoTitleTextView(Context context) {
21 | super(context);
22 | }
23 |
24 | public VDVideoTitleTextView(Context context, AttributeSet attrs) {
25 | super(context, attrs);
26 | VDVideoViewController controller = VDVideoViewController
27 | .getInstance(context);
28 | if (controller != null)
29 | controller.addOnPlayVideoListener(this);
30 | }
31 |
32 | @Override
33 | public void reset() {
34 | // TODO Auto-generated method stub
35 |
36 | }
37 |
38 | @Override
39 | public void hide() {
40 | // TODO Auto-generated method stub
41 | // VDVideoViewController.getInstance().removeOnPlayVideoListener(this);
42 | }
43 |
44 | @Override
45 | public void onVideoInfo(VDVideoInfo info) {
46 | // TODO Auto-generated method stub
47 | setText(info.mTitle);
48 | }
49 |
50 | @Override
51 | public void onShowLoading(boolean show) {
52 | // TODO Auto-generated method stub
53 |
54 | }
55 |
56 | @Override
57 | public void onVideoPrepared(boolean prepare) {
58 | // TODO Auto-generated method stub
59 |
60 | }
61 |
62 | @Override
63 | public void onPlayStateChanged() {
64 | // TODO Auto-generated method stub
65 |
66 | }
67 |
68 | }
69 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/playlist/OnPlayListItemClick.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets.playlist;
2 |
3 | public interface OnPlayListItemClick {
4 |
5 | public void onItemClick(int position);
6 | }
7 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/playlist/VDPlayListScrollListener.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets.playlist;
2 |
3 | import android.content.Context;
4 | import android.widget.AbsListView;
5 | import android.widget.AbsListView.OnScrollListener;
6 |
7 | import com.sina.sinavideo.sdk.VDVideoViewController;
8 |
9 | /**
10 | * 相关视频列表滑动监听类
11 | *
12 | * @author sina
13 | *
14 | */
15 | public class VDPlayListScrollListener implements OnScrollListener {
16 | private Context mContext;
17 | public VDPlayListScrollListener(Context context) {
18 | mContext = context;
19 | }
20 |
21 | @Override
22 | public void onScrollStateChanged(AbsListView view, int scrollState) {
23 | if (scrollState == SCROLL_STATE_IDLE) {//5 秒后隐藏
24 | VDVideoViewController controller = VDVideoViewController.getInstance(mContext);
25 | if(null!=controller)
26 | controller.notifyRemoveAndHideDelayVideoList();
27 | } else if (scrollState == SCROLL_STATE_FLING) {
28 |
29 | } else if (scrollState == SCROLL_STATE_TOUCH_SCROLL) {//移除
30 | VDVideoViewController controller = VDVideoViewController.getInstance(mContext);
31 | if(null!=controller)
32 | controller.notifyRemoveAndHideDelayVideoList();
33 | }
34 | // VDVideoViewController.getInstance().notifyHideControllerBar(VDVideoViewController.DEFAULT_DELAY);
35 | }
36 |
37 | @Override
38 | public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
39 | // VDVideoViewController.getInstance().notifyHideControllerBar(VDVideoViewController.DEFAULT_DELAY);
40 | VDVideoViewController controller = VDVideoViewController.getInstance(mContext);
41 | if(null!=controller)
42 | controller.notifyRemoveAndHideDelayVideoList();
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/playlist/VDVideoPlayListAdapter.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets.playlist;
2 |
3 | import android.view.LayoutInflater;
4 | import android.widget.BaseAdapter;
5 |
6 | import com.sina.sinavideo.sdk.data.VDVideoListInfo;
7 |
8 | /**
9 | * 相关视频列表适配器父类
10 | *
11 | * @author sina
12 | */
13 | public abstract class VDVideoPlayListAdapter extends BaseAdapter {
14 |
15 | protected LayoutInflater mInflater = null;
16 | protected int mItemID = -1;
17 | protected int mCurPlayIndex;
18 |
19 | public void setCurPlayIndex(int index) {
20 | if (mCurPlayIndex == index)
21 | return;
22 | this.mCurPlayIndex = index;
23 | notifyDataSetChanged();
24 | }
25 |
26 | public int getCurPlayIndex() {
27 | return mCurPlayIndex;
28 | }
29 |
30 | protected VDVideoListInfo mVideoList = new VDVideoListInfo();
31 |
32 | public void setVideoList(VDVideoListInfo list) {
33 | if (list != null) {
34 | mVideoList = list;
35 | }
36 | notifyDataSetChanged();
37 | }
38 |
39 | public VDVideoPlayListAdapter() {
40 |
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/playlist/VDVideoPlayListGridItemTextView.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets.playlist;
2 |
3 | import android.content.Context;
4 | import android.content.res.TypedArray;
5 | import android.graphics.Color;
6 | import android.util.AttributeSet;
7 | import android.widget.TextView;
8 |
9 | import com.sina.sinavideo.sdk.data.VDVideoInfo;
10 | import com.sina.sinavideo.sdk.widgets.VDBaseWidget;
11 | import com.sina.video_playersdkv2.R;
12 |
13 | /**
14 | * TV模式中全屏播放时相关视频列表中数据列中的文字内容
15 | * @author liuqun
16 | */
17 | public class VDVideoPlayListGridItemTextView extends TextView implements VDBaseWidget, VDVideoPlaylistBase {
18 |
19 | protected VDVideoInfo mInfo = null;
20 | protected int mVideoInfoIndex = -1;
21 | private int mCurPlayColor;
22 | private int mNoPlayColor;
23 |
24 | public VDVideoPlayListGridItemTextView(Context context, AttributeSet attrs) {
25 | super(context, attrs);
26 | TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ResolutionBackGround);
27 | int otherTextColor = Color.parseColor("#d1d1d1");
28 | int curBgColor = Color.parseColor("#0078db");
29 | mNoPlayColor = a.getColor(R.styleable.PlayListTextViewColor_NoPlayColor, otherTextColor);
30 | mCurPlayColor = a.getColor(R.styleable.PlayListTextViewColor_CurPlayColor, curBgColor);
31 | a.recycle();
32 | }
33 |
34 | @Override
35 | public void reset() {
36 |
37 | }
38 |
39 | @Override
40 | public void hide() {
41 |
42 | }
43 |
44 | @Override
45 | public void setData(VDVideoInfo info) {
46 | mInfo = info;
47 | // setText(info.mTitle);
48 | }
49 |
50 | @Override
51 | public void setVideoInfo(int infoIndex, int curPlayIndex) {
52 | mVideoInfoIndex = infoIndex;
53 | if (mVideoInfoIndex == curPlayIndex) {
54 | setTextColor(mCurPlayColor);
55 | } else {
56 | setTextColor(mNoPlayColor);
57 | }
58 | setText(String.valueOf(infoIndex + 1));
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/playlist/VDVideoPlaylistBase.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets.playlist;
2 |
3 | import com.sina.sinavideo.sdk.data.VDVideoInfo;
4 |
5 | /**
6 | * 相关视频列表中数据项的数据接口
7 | *
8 | * @author liuqun
9 | */
10 | public interface VDVideoPlaylistBase {
11 |
12 | /**
13 | * 设置当前一条数据
14 | *
15 | * @param info
16 | */
17 | public void setData(VDVideoInfo info);
18 |
19 | /**
20 | * 设置这条数据在列表中哪一个?
21 | *
22 | * @param infoIndex
23 | */
24 | public void setVideoInfo(int infoIndex, int curPlayIndex);
25 | }
26 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/playlist/VDVideoPlaylistTextView.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets.playlist;
2 |
3 | import android.content.Context;
4 | import android.content.res.TypedArray;
5 | import android.graphics.Color;
6 | import android.util.AttributeSet;
7 | import android.widget.TextView;
8 |
9 | import com.sina.sinavideo.sdk.data.VDVideoInfo;
10 | import com.sina.sinavideo.sdk.widgets.VDBaseWidget;
11 | import com.sina.video_playersdkv2.R;
12 |
13 | /**
14 | * 全屏播放时相关视频列表中数据列中的文字内容
15 | * @author liuqun
16 | */
17 | public class VDVideoPlaylistTextView extends TextView implements VDBaseWidget, VDVideoPlaylistBase {
18 |
19 | protected VDVideoInfo mInfo = null;
20 | protected int mVideoInfoIndex = -1;
21 | private int mCurPlayColor;
22 | private int mNoPlayColor;
23 |
24 | public VDVideoPlaylistTextView(Context context, AttributeSet attrs) {
25 | super(context, attrs);
26 | TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ResolutionBackGround);
27 | int otherTextColor = Color.parseColor("#d1d1d1");
28 | int curBgColor = Color.parseColor("#0078db");
29 | mNoPlayColor = a.getColor(R.styleable.PlayListTextViewColor_NoPlayColor, otherTextColor);
30 | mCurPlayColor = a.getColor(R.styleable.PlayListTextViewColor_CurPlayColor, curBgColor);
31 | a.recycle();
32 | }
33 |
34 | @Override
35 | public void reset() {
36 |
37 | }
38 |
39 | @Override
40 | public void hide() {
41 |
42 | }
43 |
44 | @Override
45 | public void setData(VDVideoInfo info) {
46 | mInfo = info;
47 | setText(info.mTitle);
48 | }
49 |
50 | @Override
51 | public void setVideoInfo(int infoIndex, int curPlayIndex) {
52 | mVideoInfoIndex = infoIndex;
53 | if (mVideoInfoIndex == curPlayIndex) {
54 | setTextColor(mCurPlayColor);
55 | } else {
56 | setTextColor(mNoPlayColor);
57 | }
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/src/com/sina/sinavideo/sdk/widgets/playlist/VDVideoRelatedTextView.java:
--------------------------------------------------------------------------------
1 | package com.sina.sinavideo.sdk.widgets.playlist;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Context;
5 | import android.util.AttributeSet;
6 | import android.view.View;
7 | import android.widget.TextView;
8 |
9 | import com.sina.sinavideo.sdk.VDVideoViewController;
10 | import com.sina.sinavideo.sdk.widgets.VDBaseWidget;
11 |
12 | /**
13 | * 相关视频
14 | *
15 | * @author liuqun
16 | *
17 | */
18 | public class VDVideoRelatedTextView extends TextView implements VDBaseWidget {
19 | @SuppressLint("nouse")
20 | private final static String TAG = "VDVideoRelatedButton";
21 |
22 | public VDVideoRelatedTextView(Context context, AttributeSet attrs) {
23 | super(context, attrs);
24 | registerListeners();
25 | }
26 |
27 | public VDVideoRelatedTextView(Context context) {
28 | super(context);
29 | registerListeners();
30 | }
31 |
32 | /**
33 | * 为自己注册事件
34 | */
35 | private void registerListeners() {
36 | // click事件
37 | this.setOnClickListener(new OnClickListener() {
38 |
39 | @Override
40 | public void onClick(View v) {
41 | VDVideoViewController controller = VDVideoViewController.getInstance(VDVideoRelatedTextView.this.getContext());
42 | if(null==controller){
43 | return;
44 | }
45 | controller.notifyHideControllerBar(0);
46 | controller.notifyToogleVideoList();
47 | }
48 |
49 | });
50 |
51 | }
52 |
53 | @Override
54 | public void reset() {
55 |
56 | }
57 |
58 | @Override
59 | public void hide() {
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/struct.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaVDDeveloper/sinavideo_playersdk/07a12d6bd0871c066f933f85762d05ce9efe8dfc/struct.png
--------------------------------------------------------------------------------