2014-05-08 18:13:50 +08:00
|
|
|
/****************************************************************************
|
2018-01-29 16:25:32 +08:00
|
|
|
Copyright (c) 2014-2016 Chukong Technologies Inc.
|
|
|
|
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
2022-02-23 17:38:21 +08:00
|
|
|
Copyright (c) 2022 Bytedance Inc.
|
2014-05-08 18:13:50 +08:00
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
https://axys1.github.io/
|
2014-05-08 18:13:50 +08:00
|
|
|
|
|
|
|
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.
|
|
|
|
****************************************************************************/
|
|
|
|
|
2022-02-24 18:13:01 +08:00
|
|
|
#include "ui/UIVideoPlayer/UIVideoPlayer.h"
|
2014-05-08 18:13:50 +08:00
|
|
|
|
2022-07-15 19:17:01 +08:00
|
|
|
#if (AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID)
|
2021-12-25 10:04:45 +08:00
|
|
|
# include <unordered_map>
|
|
|
|
# include <stdlib.h>
|
|
|
|
# include <jni.h>
|
|
|
|
# include <string>
|
|
|
|
# include "platform/android/jni/JniHelper.h"
|
|
|
|
# include "base/CCDirector.h"
|
|
|
|
# include "base/CCEventListenerKeyboard.h"
|
|
|
|
# include "platform/CCFileUtils.h"
|
|
|
|
# include "ui/UIHelper.h"
|
2014-05-08 18:13:50 +08:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------------------------------
|
2015-11-27 17:00:33 +08:00
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
static const char* videoHelperClassName = "org.axys1.lib.AxysVideoHelper";
|
2014-05-08 18:13:50 +08:00
|
|
|
|
2022-07-11 17:50:21 +08:00
|
|
|
USING_NS_AX;
|
2014-05-08 18:13:50 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
static void executeVideoCallback(int index, int event);
|
2014-07-17 21:10:26 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
# define QUIT_FULLSCREEN 1000
|
2014-07-17 21:19:09 +08:00
|
|
|
|
2014-05-08 18:13:50 +08:00
|
|
|
extern "C" {
|
2022-08-08 18:02:17 +08:00
|
|
|
JNIEXPORT void JNICALL Java_org_axys1_lib_AxysVideoHelper_nativeExecuteVideoCallback(JNIEnv*,
|
2021-12-25 10:04:45 +08:00
|
|
|
jclass,
|
|
|
|
jint index,
|
|
|
|
jint event)
|
|
|
|
{
|
|
|
|
executeVideoCallback(index, event);
|
|
|
|
}
|
2014-05-08 18:13:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
int createVideoWidgetJNI()
|
|
|
|
{
|
|
|
|
JniMethodInfo t;
|
|
|
|
int ret = -1;
|
2021-12-29 16:08:20 +08:00
|
|
|
if (JniHelper::getStaticMethodInfo(t, videoHelperClassName, "createVideoWidget", "()I"))
|
2021-12-25 10:04:45 +08:00
|
|
|
{
|
2014-05-08 18:13:50 +08:00
|
|
|
ret = t.env->CallStaticIntMethod(t.classID, t.methodID);
|
|
|
|
|
|
|
|
t.env->DeleteLocalRef(t.classID);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2019-04-11 09:33:05 +08:00
|
|
|
void setLoopingJNI(int index, bool looping)
|
|
|
|
{
|
|
|
|
JniMethodInfo t;
|
2021-12-29 16:08:20 +08:00
|
|
|
if (JniHelper::getStaticMethodInfo(t, videoHelperClassName, "setLooping", "(IZ)V"))
|
2021-12-25 10:04:45 +08:00
|
|
|
{
|
2019-04-11 09:33:05 +08:00
|
|
|
t.env->CallStaticVoidMethod(t.classID, t.methodID, index, looping);
|
|
|
|
|
|
|
|
t.env->DeleteLocalRef(t.classID);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void setUserInputEnabledJNI(int index, bool enableInput)
|
|
|
|
{
|
|
|
|
JniMethodInfo t;
|
2021-12-29 16:08:20 +08:00
|
|
|
if (JniHelper::getStaticMethodInfo(t, videoHelperClassName, "setUserInputEnabled", "(IZ)V"))
|
2021-12-25 10:04:45 +08:00
|
|
|
{
|
2019-04-11 09:33:05 +08:00
|
|
|
t.env->CallStaticVoidMethod(t.classID, t.methodID, index, enableInput);
|
|
|
|
|
|
|
|
t.env->DeleteLocalRef(t.classID);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-08 18:13:50 +08:00
|
|
|
//-----------------------------------------------------------------------------------------------------------
|
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
using namespace ax::ui;
|
2014-05-08 18:13:50 +08:00
|
|
|
|
2014-05-09 11:30:07 +08:00
|
|
|
static std::unordered_map<int, VideoPlayer*> s_allVideoPlayers;
|
2014-05-08 18:13:50 +08:00
|
|
|
|
2014-05-09 11:30:07 +08:00
|
|
|
VideoPlayer::VideoPlayer()
|
2021-12-25 10:04:45 +08:00
|
|
|
: _fullScreenDirty(false)
|
|
|
|
, _fullScreenEnabled(false)
|
|
|
|
, _keepAspectRatioEnabled(false)
|
|
|
|
, _videoPlayerIndex(-1)
|
|
|
|
, _eventCallback(nullptr)
|
|
|
|
, _isPlaying(false)
|
|
|
|
, _isLooping(false)
|
|
|
|
, _isUserInputEnabled(true)
|
|
|
|
, _styleType(StyleType::DEFAULT)
|
|
|
|
{
|
|
|
|
_videoPlayerIndex = createVideoWidgetJNI();
|
2014-05-09 11:30:07 +08:00
|
|
|
s_allVideoPlayers[_videoPlayerIndex] = this;
|
2014-09-11 15:39:56 +08:00
|
|
|
|
2022-07-15 19:17:01 +08:00
|
|
|
# if AX_VIDEOPLAYER_DEBUG_DRAW
|
2014-09-11 15:39:56 +08:00
|
|
|
_debugDrawNode = DrawNode::create();
|
2016-07-06 07:27:39 +08:00
|
|
|
addChild(_debugDrawNode);
|
2021-12-25 10:04:45 +08:00
|
|
|
# endif
|
2014-05-08 18:13:50 +08:00
|
|
|
}
|
|
|
|
|
2014-05-09 11:30:07 +08:00
|
|
|
VideoPlayer::~VideoPlayer()
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2014-05-09 11:30:07 +08:00
|
|
|
s_allVideoPlayers.erase(_videoPlayerIndex);
|
2021-12-29 16:08:20 +08:00
|
|
|
JniHelper::callStaticVoidMethod(videoHelperClassName, "removeVideoWidget", _videoPlayerIndex);
|
2014-05-08 18:13:50 +08:00
|
|
|
}
|
|
|
|
|
2021-12-26 23:26:34 +08:00
|
|
|
void VideoPlayer::setFileName(std::string_view fileName)
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
_videoURL = FileUtils::getInstance()->fullPathForFilename(fileName);
|
2014-05-14 14:44:04 +08:00
|
|
|
_videoSource = VideoPlayer::Source::FILENAME;
|
2021-12-29 16:08:20 +08:00
|
|
|
JniHelper::callStaticVoidMethod(videoHelperClassName, "setVideoUrl", _videoPlayerIndex, (int)Source::FILENAME,
|
2021-12-25 10:04:45 +08:00
|
|
|
_videoURL);
|
2014-05-08 18:13:50 +08:00
|
|
|
}
|
|
|
|
|
2021-12-26 23:26:34 +08:00
|
|
|
void VideoPlayer::setURL(std::string_view videoUrl)
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
_videoURL = videoUrl;
|
2014-05-14 14:44:04 +08:00
|
|
|
_videoSource = VideoPlayer::Source::URL;
|
2021-12-29 16:08:20 +08:00
|
|
|
JniHelper::callStaticVoidMethod(videoHelperClassName, "setVideoUrl", _videoPlayerIndex, (int)Source::URL,
|
2021-12-25 10:04:45 +08:00
|
|
|
_videoURL);
|
2014-05-08 18:13:50 +08:00
|
|
|
}
|
|
|
|
|
2019-04-11 09:33:05 +08:00
|
|
|
void VideoPlayer::setLooping(bool looping)
|
|
|
|
{
|
|
|
|
_isLooping = looping;
|
|
|
|
setLoopingJNI(_videoPlayerIndex, _isLooping);
|
|
|
|
}
|
|
|
|
|
|
|
|
void VideoPlayer::setUserInputEnabled(bool enableInput)
|
|
|
|
{
|
|
|
|
_isUserInputEnabled = enableInput;
|
|
|
|
setUserInputEnabledJNI(_videoPlayerIndex, enableInput);
|
|
|
|
}
|
|
|
|
|
|
|
|
void VideoPlayer::setStyle(StyleType style)
|
|
|
|
{
|
|
|
|
_styleType = style;
|
|
|
|
}
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
void VideoPlayer::draw(Renderer* renderer, const Mat4& transform, uint32_t flags)
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2022-08-08 18:02:17 +08:00
|
|
|
ax::ui::Widget::draw(renderer, transform, flags);
|
2014-05-08 18:13:50 +08:00
|
|
|
|
2014-07-17 21:10:26 +08:00
|
|
|
if (flags & FLAGS_TRANSFORM_DIRTY)
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2022-08-08 18:02:17 +08:00
|
|
|
auto uiRect = ax::ui::Helper::convertBoundingBoxToScreen(this);
|
2021-12-29 16:08:20 +08:00
|
|
|
JniHelper::callStaticVoidMethod(videoHelperClassName, "setVideoRect", _videoPlayerIndex, (int)uiRect.origin.x,
|
2021-12-25 10:04:45 +08:00
|
|
|
(int)uiRect.origin.y, (int)uiRect.size.width, (int)uiRect.size.height);
|
2014-05-08 18:13:50 +08:00
|
|
|
}
|
|
|
|
|
2022-07-15 19:17:01 +08:00
|
|
|
# if AX_VIDEOPLAYER_DEBUG_DRAW
|
2014-09-11 15:39:56 +08:00
|
|
|
_debugDrawNode->clear();
|
2021-12-25 10:04:45 +08:00
|
|
|
auto size = getContentSize();
|
|
|
|
Point vertices[4] = {Point::ZERO, Point(size.width, 0), Point(size.width, size.height), Point(0, size.height)};
|
2022-02-23 18:39:02 +08:00
|
|
|
_debugDrawNode->drawPoly(vertices, 4, true, Color4F(1.0, 1.0, 1.0, 1.0));
|
2021-12-25 10:04:45 +08:00
|
|
|
# endif
|
2014-05-08 18:13:50 +08:00
|
|
|
}
|
|
|
|
|
2014-05-09 11:30:07 +08:00
|
|
|
void VideoPlayer::setFullScreenEnabled(bool enabled)
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
|
|
|
if (_fullScreenEnabled != enabled)
|
|
|
|
{
|
|
|
|
_fullScreenEnabled = enabled;
|
2014-07-17 21:10:26 +08:00
|
|
|
|
|
|
|
auto frameSize = Director::getInstance()->getOpenGLView()->getFrameSize();
|
2021-12-29 16:08:20 +08:00
|
|
|
JniHelper::callStaticVoidMethod(videoHelperClassName, "setFullScreenEnabled", _videoPlayerIndex, enabled,
|
2021-12-25 10:04:45 +08:00
|
|
|
(int)frameSize.width, (int)frameSize.height);
|
2014-05-08 18:13:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
bool VideoPlayer::isFullScreenEnabled() const
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
|
|
|
return _fullScreenEnabled;
|
|
|
|
}
|
|
|
|
|
2014-05-09 11:30:07 +08:00
|
|
|
void VideoPlayer::setKeepAspectRatioEnabled(bool enable)
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
|
|
|
if (_keepAspectRatioEnabled != enable)
|
|
|
|
{
|
|
|
|
_keepAspectRatioEnabled = enable;
|
2021-12-29 16:08:20 +08:00
|
|
|
JniHelper::callStaticVoidMethod(videoHelperClassName, "setVideoKeepRatioEnabled", _videoPlayerIndex, enable);
|
2014-05-08 18:13:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-28 12:14:08 +08:00
|
|
|
void VideoPlayer::setPlayRate(float fRate) {}
|
|
|
|
|
2014-05-14 14:44:04 +08:00
|
|
|
void VideoPlayer::play()
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
if (!_videoURL.empty())
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2021-12-29 16:08:20 +08:00
|
|
|
JniHelper::callStaticVoidMethod(videoHelperClassName, "startVideo", _videoPlayerIndex);
|
2014-05-08 18:13:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-14 14:44:04 +08:00
|
|
|
void VideoPlayer::pause()
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
if (!_videoURL.empty())
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2021-12-29 16:08:20 +08:00
|
|
|
JniHelper::callStaticVoidMethod(videoHelperClassName, "pauseVideo", _videoPlayerIndex);
|
2014-05-08 18:13:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-14 14:44:04 +08:00
|
|
|
void VideoPlayer::resume()
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
if (!_videoURL.empty())
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2021-12-29 16:08:20 +08:00
|
|
|
JniHelper::callStaticVoidMethod(videoHelperClassName, "resumeVideo", _videoPlayerIndex);
|
2014-05-08 18:13:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-14 14:44:04 +08:00
|
|
|
void VideoPlayer::stop()
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
if (!_videoURL.empty())
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2021-12-29 16:08:20 +08:00
|
|
|
JniHelper::callStaticVoidMethod(videoHelperClassName, "stopVideo", _videoPlayerIndex);
|
2014-05-08 18:13:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-14 14:44:04 +08:00
|
|
|
void VideoPlayer::seekTo(float sec)
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
if (!_videoURL.empty())
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2021-12-29 16:08:20 +08:00
|
|
|
JniHelper::callStaticVoidMethod(videoHelperClassName, "seekVideoTo", _videoPlayerIndex, int(sec * 1000));
|
2014-05-08 18:13:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-09 11:30:07 +08:00
|
|
|
bool VideoPlayer::isPlaying() const
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
|
|
|
return _isPlaying;
|
|
|
|
}
|
|
|
|
|
2019-04-11 09:33:05 +08:00
|
|
|
bool VideoPlayer::isLooping() const
|
|
|
|
{
|
|
|
|
return _isLooping;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool VideoPlayer::isUserInputEnabled() const
|
|
|
|
{
|
|
|
|
return _isUserInputEnabled;
|
|
|
|
}
|
|
|
|
|
2014-05-09 11:30:07 +08:00
|
|
|
void VideoPlayer::setVisible(bool visible)
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2022-08-08 18:02:17 +08:00
|
|
|
ax::ui::Widget::setVisible(visible);
|
2014-05-08 18:13:50 +08:00
|
|
|
|
2016-05-16 15:22:11 +08:00
|
|
|
if (!visible || isRunning())
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2021-12-29 16:08:20 +08:00
|
|
|
JniHelper::callStaticVoidMethod(videoHelperClassName, "setVideoVisible", _videoPlayerIndex, visible);
|
2016-05-16 15:22:11 +08:00
|
|
|
}
|
2014-05-08 18:13:50 +08:00
|
|
|
}
|
|
|
|
|
2016-05-05 10:20:00 +08:00
|
|
|
void VideoPlayer::onEnter()
|
|
|
|
{
|
|
|
|
Widget::onEnter();
|
2016-05-16 15:22:11 +08:00
|
|
|
if (isVisible() && !_videoURL.empty())
|
|
|
|
{
|
2021-12-29 16:08:20 +08:00
|
|
|
JniHelper::callStaticVoidMethod(videoHelperClassName, "setVideoVisible", _videoPlayerIndex, true);
|
2016-05-16 15:22:11 +08:00
|
|
|
}
|
2016-05-05 10:20:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void VideoPlayer::onExit()
|
|
|
|
{
|
|
|
|
Widget::onExit();
|
2021-12-29 16:08:20 +08:00
|
|
|
JniHelper::callStaticVoidMethod(videoHelperClassName, "setVideoVisible", _videoPlayerIndex, false);
|
2016-05-05 10:20:00 +08:00
|
|
|
}
|
|
|
|
|
2014-05-14 14:44:04 +08:00
|
|
|
void VideoPlayer::addEventListener(const VideoPlayer::ccVideoPlayerCallback& callback)
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2014-05-14 14:44:04 +08:00
|
|
|
_eventCallback = callback;
|
2014-05-08 18:13:50 +08:00
|
|
|
}
|
|
|
|
|
2014-07-17 21:10:26 +08:00
|
|
|
void VideoPlayer::onPlayEvent(int event)
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2014-07-17 21:19:09 +08:00
|
|
|
if (event == QUIT_FULLSCREEN)
|
2014-07-17 21:10:26 +08:00
|
|
|
{
|
|
|
|
_fullScreenEnabled = false;
|
2021-12-25 10:04:45 +08:00
|
|
|
}
|
2014-07-17 21:10:26 +08:00
|
|
|
else
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2014-07-17 21:10:26 +08:00
|
|
|
VideoPlayer::EventType videoEvent = (VideoPlayer::EventType)event;
|
2021-12-25 10:04:45 +08:00
|
|
|
if (videoEvent == VideoPlayer::EventType::PLAYING)
|
|
|
|
{
|
2014-07-17 21:10:26 +08:00
|
|
|
_isPlaying = true;
|
2021-12-25 10:04:45 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-07-17 21:10:26 +08:00
|
|
|
_isPlaying = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_eventCallback)
|
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
_eventCallback(this, videoEvent);
|
2014-07-17 21:10:26 +08:00
|
|
|
}
|
2014-05-08 18:13:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
ax::ui::Widget* VideoPlayer::createCloneInstance()
|
2014-05-23 15:03:46 +08:00
|
|
|
{
|
|
|
|
return VideoPlayer::create();
|
|
|
|
}
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
void VideoPlayer::copySpecialProperties(Widget* widget)
|
2014-05-23 15:03:46 +08:00
|
|
|
{
|
|
|
|
VideoPlayer* videoPlayer = dynamic_cast<VideoPlayer*>(widget);
|
|
|
|
if (videoPlayer)
|
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
_isPlaying = videoPlayer->_isPlaying;
|
|
|
|
_isLooping = videoPlayer->_isLooping;
|
|
|
|
_isUserInputEnabled = videoPlayer->_isUserInputEnabled;
|
|
|
|
_styleType = videoPlayer->_styleType;
|
|
|
|
_fullScreenEnabled = videoPlayer->_fullScreenEnabled;
|
|
|
|
_fullScreenDirty = videoPlayer->_fullScreenDirty;
|
|
|
|
_videoURL = videoPlayer->_videoURL;
|
2014-05-23 15:03:46 +08:00
|
|
|
_keepAspectRatioEnabled = videoPlayer->_keepAspectRatioEnabled;
|
2021-12-25 10:04:45 +08:00
|
|
|
_videoSource = videoPlayer->_videoSource;
|
|
|
|
_videoPlayerIndex = videoPlayer->_videoPlayerIndex;
|
|
|
|
_eventCallback = videoPlayer->_eventCallback;
|
2014-05-23 15:03:46 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
void executeVideoCallback(int index, int event)
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2014-05-09 11:30:07 +08:00
|
|
|
auto it = s_allVideoPlayers.find(index);
|
|
|
|
if (it != s_allVideoPlayers.end())
|
2014-05-08 18:13:50 +08:00
|
|
|
{
|
2014-07-17 21:10:26 +08:00
|
|
|
s_allVideoPlayers[index]->onPlayEvent(event);
|
2014-05-08 18:13:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-06-05 00:48:35 +08:00
|
|
|
#endif
|