Cocos2dxVideoView.java:private boolean isLoop = false;//添加方法public void setLooping(boolean loop) {    this.isLoop = loop;    if(mMediaPlayer!=null){    mMediaPlayer.setLooping(loop);    }}//修改public void start() {    if (isInPlaybackState()) {        if(this.isLoop){ //播放的时候设置为循环播放        this.setLooping(true);        }        mMediaPlayer.start();        mCurrentState = STATE_PLAYING;        if (mOnVideoEventListener != null) {            mOnVideoEventListener.onVideoEvent(mViewTag, EVENT_PLAYING);        }    }    mTargetState = STATE_PLAYING;}Cocos2dxVideoHelper.java:private final static int VideoTaskSetLooping = 13;@Overridepublic void handleMessage(Message msg) {case VideoTaskSetLooping:{        //_setLooping        Cocos2dxVideoHelper helper = mReference.get();        if(msg.arg2 == 0){            helper._setVideoLooping(msg.arg1,false);        }else{            helper._setVideoLooping(msg.arg1,true);        }break;    }}public static void setVideoLooping(int index,int isLoop) {    Message msg = new Message();    msg.what = VideoTaskSetLooping;    msg.arg1 = index;    msg.arg2 = isLoop;    mVideoHandler.sendMessage(msg);}    public void _setVideoLooping(int index,boolean isLoop) {    Cocos2dxVideoView view = sVideoViews.get(index);    if(view!=null){    view.setLooping(isLoop);    }}C:\Cocos\frameworks\cocos2d-x-3.9\cocos\ui\UIVideoPlayer.hvirtual void setVideoLooping(bool isLoop);C:\Cocos\frameworks\cocos2d-x-3.9\cocos\ui\UIVideoPlayer-android.cppvoid VideoPlayer::setVideoLooping(bool isLoop){if (isLoop) {setVideoLoopingJNI(_videoPlayerIndex, 1);}else {setVideoLoopingJNI(_videoPlayerIndex, 0);}}void setVideoLoopingJNI(int index, int isLoop) {JniMethodInfo t;if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, "setVideoLooping", "(II)V")) {t.env->CallStaticVoidMethod(t.classID, t.methodID, index, isLoop);t.env->DeleteLocalRef(t.classID);}}C:\Cocos\frameworks\cocos2d-x-3.9\cocos\scripting\js-bindings\auto\jsb_cocos2dx_experimental_video_auto.hppbool js_cocos2dx_experimental_video_VideoPlayer_setVideoLooping(JSContext *cx, uint32_t argc, jsval *vp);C:\Cocos\frameworks\cocos2d-x-3.9\cocos\scripting\js-bindings\auto\jsb_cocos2dx_experimental_video_auto.cppbool js_cocos2dx_experimental_video_VideoPlayer_setVideoLooping(JSContext *cx, uint32_t argc, jsval *vp){JS::CallArgs args = JS::CallArgsFromVp(argc, vp);bool ok = true;JS::RootedObject obj(cx, args.thisv().toObjectOrNull());js_proxy_t *proxy = jsb_get_js_proxy(obj);cocos2d::experimental::ui::VideoPlayer* cobj = (cocos2d::experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL);JSB_PRECONDITION2(cobj, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_setVideoLooping : Invalid Native Object");if (argc == 1) {bool arg0;arg0 = JS::ToBoolean(args.get(0));JSB_PRECONDITION2(ok, cx, false, "js_cocos2dx_experimental_video_VideoPlayer_setVideoLooping : Error processing arguments");cobj->setVideoLooping(arg0);args.rval().setUndefined();return true;}JS_ReportError(cx, "js_cocos2dx_experimental_video_VideoPlayer_setVideoLooping : wrong number of arguments: %d, was expecting %d", argc, 1);return false;}static JSFunctionSpec funcs[] = {    //注册方法JS_FN("setVideoLooping", js_cocos2dx_experimental_video_VideoPlayer_setVideoLooping, 1, JSPROP_PERMANENT | JSPROP_ENUMERATE),        JS_FS_END};

 

更多相关文章

  1. GPS开发常用方法 和用Criteria确定android location providerGPS
  2. Android Dialog触摸对话框外部让其消失的实现方法
  3. android 获取当前时间的方法
  4. Android ScrollView嵌套ViewPager不显示和出现空白部分 解决方法
  5. Android查询所有联系人和根据号码查询联系人方法
  6. Android系统信息查看方法

随机推荐

  1. MySQL的加密解密的几种方式(小结)
  2. mysql的联合索引(复合索引)的实现
  3. Mysql性能优化之索引下推
  4. MySQL中一些鲜为人知的排序方式
  5. MySQL在线DDL工具 gh-ost的原理解析
  6. MySQL巧用sum、case和when优化统计查询
  7. MySQL中sum函数使用的实例教程
  8. 浅谈为什么MySQL不推荐使用子查询和join
  9. MySQL中 and or 查询的优先级分析
  10. MySQL中查看数据库安装路径的方法