- Notifications
You must be signed in to change notification settings - Fork482
Video player test#1670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
jianglong0156 wants to merge10 commits intococos2d:developChoose a base branch fromjianglong0156:videoPlayerTest
base:develop
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Open
Video player test#1670
Changes fromall commits
Commits
Show all changes
10 commits Select commitHold shift + click to select a range
fb91001 remove old videoPlayer ini
jianglong0156-blip3ad0ade feather #1177: add videoPlayer jsb ini
jianglong0156-blip1c7716d feather #1177: add videoPlayer test gui
jianglong0156-blip9c482b6 feather #1177: add videoPlayer test logic and resource
jianglong0156-blipc7e5632 feather #1177: modify js-test android mk
jianglong0156-blip7ba8ac2 feather #1177: modify online vedio address
jianglong0156-blip53005bf feather #1177: delete other class
jianglong0156-blipabc3d05 feather #1177: modify manual name
jianglong0156-blip717d949 add iOS project,
85763a8 feather #1177: improve test case
jianglong0156-blipFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
5 changes: 3 additions & 2 deletionsframeworks/js-bindings/bindings/Android.mk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions...works/js-bindings/bindings/manual/experimental/jsb_cocos2dx_experimental_video_manual.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| #include "jsb_cocos2dx_experimental_video_manual.h" | ||
| #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) | ||
| #include "UIVideoPlayer.h" | ||
| #include "ScriptingCore.h" | ||
| #include "cocos2d_specifics.hpp" | ||
| #include "cocos2d.h" | ||
| using namespace cocos2d; | ||
| static bool jsb_cocos2dx_experimental_ui_VideoPlayer_addEventListener(JSContext *cx, uint32_t argc, jsval *vp) | ||
| { | ||
| JSObject *obj = JS_THIS_OBJECT(cx, vp); | ||
| js_proxy_t *proxy = jsb_get_js_proxy(obj); | ||
| experimental::ui::VideoPlayer* cobj = (experimental::ui::VideoPlayer *)(proxy ? proxy->ptr : NULL); | ||
| JSB_PRECONDITION2( cobj, cx, false, "Invalid Native Object"); | ||
| if(argc == 1){ | ||
| JS::CallArgs args = JS::CallArgsFromVp(argc, vp); | ||
| std::shared_ptr<JSFunctionWrapper> func(new JSFunctionWrapper(cx, obj, args.get(0))); | ||
| cobj->addEventListener([=](Ref* widget, experimental::ui::VideoPlayer::EventType type)->void{ | ||
| jsval arg[2]; | ||
| js_proxy_t *proxy = js_get_or_create_proxy(cx, widget); | ||
| if(proxy) | ||
| arg[0] = OBJECT_TO_JSVAL(proxy->obj); | ||
| else | ||
| arg[0] = JSVAL_NULL; | ||
| arg[1] = int32_to_jsval(cx, (int32_t)type); | ||
| JS::RootedValue rval(cx); | ||
| bool ok = func->invoke(2, arg, &rval); | ||
| if (!ok && JS_IsExceptionPending(cx)) { | ||
| JS_ReportPendingException(cx); | ||
| } | ||
| }); | ||
| return true; | ||
| } | ||
| } | ||
| extern JSObject* jsb_cocos2d_experimental_ui_VideoPlayer_prototype; | ||
| void register_all_cocos2dx_experimental_video_manual(JSContext* cx, JS::HandleObject global) | ||
| { | ||
| JS_DefineFunction(cx, JS::RootedObject(cx, jsb_cocos2d_experimental_ui_VideoPlayer_prototype), "addEventListener", jsb_cocos2dx_experimental_ui_VideoPlayer_addEventListener, 1, JSPROP_ENUMERATE | JSPROP_PERMANENT); | ||
| } | ||
| #endif |
9 changes: 9 additions & 0 deletionsframeworks/js-bindings/bindings/manual/experimental/jsb_cocos2dx_experimental_video_manual.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #ifndef __jsb_cocos2dx_experimental_video_manual__ | ||
| #define __jsb_cocos2dx_experimental_video_manual__ | ||
| #include "jsapi.h" | ||
| #include "jsfriendapi.h" | ||
| void register_all_cocos2dx_experimental_video_manual(JSContext* cx, JS::HandleObject global); | ||
| #endif /* defined(__jsb_cocos2dx_experimental_video_manual__) */ |
32 changes: 32 additions & 0 deletionsframeworks/js-bindings/bindings/proj.ios_mac/cocos2d_js_bindings.xcodeproj/project.pbxproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletionsframeworks/js-bindings/bindings/script/experimental/jsb_experimental.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| /* | ||
| * Copyright (c) 2013-2014 Chukong Technologies Inc. | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| * of this software and associated documentation files (the "Software"), to deal | ||
| * in the Software without restriction, including without limitation the rights | ||
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| * copies of the Software, and to permit persons to whom the Software is | ||
| * furnished to do so, subject to the following conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be included in | ||
| * all copies or substantial portions of the Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
| * THE SOFTWARE. | ||
| */ | ||
| var ccexp = ccexp || {}; | ||
| ccexp.VideoPlayer.PLAYING = 0; | ||
| ccexp.VideoPlayer.PAUSED = 1; | ||
| ccexp.VideoPlayer.STOPPED = 2; | ||
| ccexp.VideoPlayer.COMPLETED = 3; |
4 changes: 4 additions & 0 deletionsframeworks/js-bindings/bindings/script/jsb.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletionssamples/js-tests/project.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletionssamples/js-tests/project/Classes/AppDelegate.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Binary file addedsamples/js-tests/res/cocosvideo.mp4
Binary file not shown.
8 changes: 8 additions & 0 deletionssamples/js-tests/src/GUITest/UISceneManager.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.