Commit 71af70a4 authored by mengcuiguang's avatar mengcuiguang

添加预缓存

parent f0cc5af9
...@@ -181,8 +181,10 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView, ...@@ -181,8 +181,10 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView,
player.startVideoAfterPreloading() player.startVideoAfterPreloading()
// VIdeoindex -> seeIndex // VIdeoindex -> seeIndex
if (videos.size > mCurrentPosition) {
mVedioBean!!.seeIndex = videos[mCurrentPosition].vedioIndex mVedioBean!!.seeIndex = videos[mCurrentPosition].vedioIndex
LocalVedioManager.commitVedio(mVedioBean!!) LocalVedioManager.commitVedio(mVedioBean!!)
}
//播放开始,进行倒计时 //播放开始,进行倒计时
} }
...@@ -362,6 +364,8 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView, ...@@ -362,6 +364,8 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView,
} }
private fun showVipCountDialog(position: Int) { private fun showVipCountDialog(position: Int) {
if (isFinishing) return
if (mVedioBean!!.tipMaxIndex == 0 || mVedioBean!!.tipMaxIndex - 1 < position) { if (mVedioBean!!.tipMaxIndex == 0 || mVedioBean!!.tipMaxIndex - 1 < position) {
autoPlayVideo() autoPlayVideo()
return return
......
...@@ -101,8 +101,8 @@ class VideoAdapter(private var vedioBean: VedioBean) : ...@@ -101,8 +101,8 @@ class VideoAdapter(private var vedioBean: VedioBean) :
//缓存当前,播放当前 //缓存当前,播放当前
val proxyUrl = proxy?.getProxyUrl(item.video.vedioUrl).toString() //设置视 val proxyUrl = proxy?.getProxyUrl(item.video.vedioUrl).toString() //设置视
// setPlay(holder.getView(R.id.jz_video), proxyUrl) setPlay(holder.getView(R.id.jz_video), proxyUrl)
setPlay(holder.getView(R.id.jz_video), item.video.vedioUrl) // setPlay(holder.getView(R.id.jz_video), item.video.vedioUrl)
} }
fun setPlay(jzvdStdTikTok: JzvdStdTikTok, path: String) { fun setPlay(jzvdStdTikTok: JzvdStdTikTok, path: String) {
......
...@@ -153,8 +153,8 @@ ...@@ -153,8 +153,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginLeft="15dp" android:layout_marginLeft="10dp"
android:layout_marginRight="15dp" android:layout_marginRight="10dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:background="@drawable/shape_bg_black"> android:background="@drawable/shape_bg_black">
...@@ -173,10 +173,10 @@ ...@@ -173,10 +173,10 @@
<TextView <TextView
android:id="@+id/tv_main_watching_name" android:id="@+id/tv_main_watching_name"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:text="我去平行时空" android:text="我去平行时空我去平行时空"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="14sp" /> android:textSize="14sp" />
...@@ -203,30 +203,27 @@ ...@@ -203,30 +203,27 @@
</LinearLayout> </LinearLayout>
<RelativeLayout <RelativeLayout
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent">
android:layout_weight="1">
<ImageView <ImageView
android:id="@+id/iv_main_watching_close" android:id="@+id/iv_main_watching_close"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="10dp" android:padding="6dp"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:src="@mipmap/ic_quit_white"></ImageView> android:src="@mipmap/ic_quit_white"></ImageView>
<TextView <TextView
android:id="@+id/tv_main_watching_goto" android:id="@+id/tv_main_watching_goto"
android:layout_width="120dp" android:layout_width="100dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginRight="30dp"
android:background="@drawable/shape_red" android:background="@drawable/shape_red"
android:layout_marginRight="15dp"
android:gravity="center" android:gravity="center"
android:paddingLeft="30dp"
android:paddingTop="8dp" android:paddingTop="8dp"
android:paddingRight="30dp"
android:paddingBottom="10dp" android:paddingBottom="10dp"
android:text="继续观看" android:text="继续观看"
android:textColor="@color/white" android:textColor="@color/white"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment