-
@param datas
-
@param layoutId
*/
public VideoAdapter(Context context, List datas, int layoutId) {
super(context, layoutId, datas);
this.mContext = context;
}
@Override
protected void convert(ViewHolder viewHolder, String url, int position) {
JCVideoPlayerStandard player = viewHolder.getView(R.id.player_list_video);
if (player != null) {
player.release();
}
player.setUp(url, JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL, “爸爸去买几个橘子就回”);
}
}
适配器很简单
4,主活动代码
/**
-
主活动
-
@author zhangyan
*/
public class MainActivity extends AppCompatActivity {
//在线视频
private String videoUrl = “http://video.jiecao.fm/5/1/%E8%87%AA%E5%8F%96%E5%85%B6%E8%BE%B1.mp4”;
private String videoUrl1 = “http://112.253.22.157/17/z/z/y/u/zzyuasjwufnqerzvyxgkuigrkcatxr/hc.yinyuetai.com/D046015255134077DDB3ACA0D7E68D45.flv”;
private String videoUrl2 = “https://key002.ku6.com/xy/d7b3278e106341908664638ac5e92802.mp4”;
private String videoUrl3 = “https://key002.ku6.com/xy/d7b3278e106341908664638ac5e92802.mp4”;
private String videoUrl4 = “