Commit c8fb9eca7fce0d980d47461bafcead508eacc5f3
1 parent
e5e73e59
更新Jar
Showing
4 changed files
with
3 additions
and
49 deletions
app/libs/libcnliveutil.jar
No preview for this file type
app/libs/libcnlivevideo.jar
No preview for this file type
app/src/main/java/com/cnlive/demo/video/VideoViewActivity.java
| ... | ... | @@ -7,9 +7,6 @@ import com.cnlive.demo.video.model.ProgramVod; |
| 7 | 7 | import com.cnlive.libs.video.video.VideoView; |
| 8 | 8 | import com.cnlive.libs.video.video.base.IMediaPlayer; |
| 9 | 9 | |
| 10 | -import static com.cnlive.libs.util.auth.AuthUtil.AUTH_ERROR; | |
| 11 | -import static com.cnlive.libs.util.auth.AuthUtil.AUTH_SUCCESS; | |
| 12 | - | |
| 13 | 10 | |
| 14 | 11 | public class VideoViewActivity extends Activity { |
| 15 | 12 | |
| ... | ... | @@ -43,62 +40,24 @@ public class VideoViewActivity extends Activity { |
| 43 | 40 | private void initPlay() { |
| 44 | 41 | videoView = (VideoView) findViewById(R.id.videoview); |
| 45 | 42 | //认证APP播放权限(使用视讯中国资源) |
| 46 | - videoView.auth(); | |
| 47 | - videoView.setOnBufferingUpdateListener(new IMediaPlayer.OnBufferingUpdateListener() { | |
| 48 | - @Override | |
| 49 | - public void onBufferingUpdate(IMediaPlayer mediaplayer, int percent) { | |
| 50 | - } | |
| 51 | - }); | |
| 52 | - videoView.setOnPlayStateListener(new IMediaPlayer.OnPlayStateListener() { | |
| 53 | - @Override | |
| 54 | - public void onPlayState(boolean isPlay) { | |
| 55 | - } | |
| 56 | - }); | |
| 57 | - videoView.setOnInfoListener(new IMediaPlayer.OnInfoListener() { | |
| 58 | - @Override | |
| 59 | - public boolean onInfo(IMediaPlayer mediaplayer, int what, int extra) { | |
| 60 | - switch (what) { | |
| 61 | - case AUTH_SUCCESS: | |
| 62 | -// auth = true; | |
| 63 | - startPlay(); | |
| 64 | - break; | |
| 65 | - } | |
| 66 | - return false; | |
| 67 | - } | |
| 68 | - }); | |
| 69 | - videoView.setOnErrorListener(new IMediaPlayer.OnErrorListener() { | |
| 70 | - @Override | |
| 71 | - public boolean onError(IMediaPlayer mediaplayer, int what, int extra) { | |
| 72 | - switch (what) { | |
| 73 | - case AUTH_ERROR: | |
| 74 | - break; | |
| 75 | - } | |
| 76 | - return false; | |
| 77 | - } | |
| 78 | - }); | |
| 79 | 43 | videoView.setOnPreparedListener(new IMediaPlayer.OnPreparedListener() { |
| 80 | 44 | @Override |
| 81 | 45 | public void onPrepared(IMediaPlayer mediaplayer) { |
| 82 | 46 | mediaplayer.start(); |
| 83 | 47 | } |
| 84 | 48 | }); |
| 85 | - videoView.setOnCompletionListener(new IMediaPlayer.OnCompletionListener() { | |
| 86 | - @Override | |
| 87 | - public void onCompletion(IMediaPlayer mediaplayer) { | |
| 88 | - } | |
| 89 | - }); | |
| 90 | 49 | |
| 91 | 50 | startPlay(); |
| 92 | 51 | } |
| 93 | 52 | |
| 94 | 53 | private void startPlay() { |
| 95 | - //视讯云 直播 | |
| 54 | +// //视讯云 直播 | |
| 96 | 55 | // videoView.setDataSource(new ProgramLive(),false); |
| 97 | 56 | |
| 98 | 57 | //视讯云 点播 |
| 99 | - videoView.setDataSourceByAuth(new ProgramVod(), false); | |
| 58 | + videoView.setDataSource(new ProgramVod(), false); | |
| 100 | 59 | |
| 101 | - //本地视频 | |
| 60 | +// //本地视频 | |
| 102 | 61 | // try { |
| 103 | 62 | // videoView.setDataSource("rtmp://live.hkstv.hk.lxdns.com/live/hks"); |
| 104 | 63 | // } catch (IOException e) { | ... | ... |
app/src/main/res/layout/activity_videoview.xml
| ... | ... | @@ -16,9 +16,4 @@ |
| 16 | 16 | android:layout_centerInParent="true" /> |
| 17 | 17 | </RelativeLayout> |
| 18 | 18 | |
| 19 | - <Button | |
| 20 | - android:id="@+id/switch_view" | |
| 21 | - android:layout_width="wrap_content" | |
| 22 | - android:layout_height="wrap_content" | |
| 23 | - android:onClick="onClick" /> | |
| 24 | 19 | </RelativeLayout> |
| 25 | 20 | \ No newline at end of file | ... | ... |