cocos2dx_视频/音频播放

android MediaPlayer 分析使用
MediaPlayer 官方文档

待分析完善

WebView

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// add webview
auto webview = cocos2d::experimental::ui::WebView::create();
Size *_size = new Size(visibleSize.width-100, visibleSize.height-100);
webview->setContentSize(*_size);
webview->setPosition(Vec2(origin.x + visibleSize.width/2, origin.y + visibleSize.height/2));
webview->setScalesPageToFit(true);
webview->setBounces(false);
webview->loadURL("https://www.baidu.com/");

webview->setOnShouldStartLoading([](cocos2d::experimental::ui::WebView *sender, const std::string &url){
return true;
});

webview->setOnDidFinishLoading([](cocos2d::experimental::ui::WebView *sender, const std::string &url){
});


webview->setOnDidFailLoading([](cocos2d::experimental::ui::WebView *sender, const std::string &url){
});

this->addChild(webview);

openUrl

1
cc.Application:getInstance():openUrl("https://www.baidu.com")

cocos2dx_视频/音频播放
https://leafflow.top/2023/02/07/other/cocos2dx-视频-音频播放/
作者
vollen
发布于
2023年2月7日
许可协议