forked from cocos/cocos-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cocos#765 from xunyi0/master
sync branch
- Loading branch information
Showing
14 changed files
with
141 additions
and
152 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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 @@ | ||
# Audio Compatibility | ||
|
||
## DOM Audio | ||
|
||
The average browser supports the **Audio** tag to play audio. The __DOM Audio__ mode in the engine plays a series of sounds by creating an audio tag. However, the following may occur on some browsers: | ||
|
||
1. In some mobile browsers, the **Audio** callback is missing, which will cause a long load time. So we try to recommend __WebAudio__ (see below). | ||
2. The browser on IOS must be in the event trigger function actively operated by the user to play this type of audio. Active playback using javascript may be ignored. | ||
|
||
## WebAudio | ||
|
||
__WebAudio__ compatibility is much better than __DOM__ mode, but there are some special considerations to think about: | ||
|
||
1. On IOS, the default __WebAudio__ timeline will not advance. The timeline will only start after the user touches and plays the audio for the first time. This means that the page may not be able to start and play background music. The best way to do this is to guide the user through the screen and then play the sound. | ||
|
||
## IOS WeChat automatically plays audio | ||
|
||
After loading the __js sdk__ in WeChat, the `WeixinJSBridgeReady` event, can be used to also play audio. If you need to start playing background music immediately, use the following: | ||
|
||
```javascript | ||
document.addEventListener('WeixinJSBridgeReady', function () { | ||
var audio = document.createElement('audio'); | ||
audio.src = cc.url.raw('resources/audio/music_logo.mp3'); | ||
audio.play(); | ||
}); | ||
``` | ||
|
||
And after the engine is started, make sure to stop playing this audio before playing audio in other ways. |
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,67 +1,58 @@ | ||
# 发布到 QQ「玩一玩」平台 | ||
# Publishing to __QQ Play__ | ||
|
||
QQ「玩一玩」与微信小游戏类似,内置于 QQ 中,无需下载游戏就能玩转多款热门手游。玩一玩的底层 runtime 并不是真正的 HTML 浏览器内核,而是玩一玩自研的 Bricks 游戏引擎。Cocos Creator 从 v1.9 版本开始就支持游戏内容跨平台发布到 QQ「玩一玩」。 | ||
|
||
作为跨平台游戏引擎方,Creator 为用户完成的主要工作包括: | ||
__QQ Play__ is similar to __WeChat Mini Games__, but built on the __QQ__ platform. __QQ Play__ allows you to play a variety of popular mobile games *without downloading* them. The underlying runtime of **QQ Play** is not a real HTML browser kernel, but a self-developed Bricks game engine. __Cocos Creator__ has supported game content cross-platform publishing to __QQ Play__ since v1.9. | ||
|
||
- 引擎负责适配 QQ「玩一玩」平台,用户的游戏逻辑代码不需要任何额外的修改 | ||
- Cocos Creator 编辑器提供打包流程,可直接发布为符合 QQ「玩一玩」技术规范的游戏 | ||
- 支持 QQ「玩一玩」平台标准的远程资源加载、缓存,以及缓存资源的版本控制 | ||
As a cross-platform game engine, __Cocos Creator's__ main tasks for users include: | ||
|
||
## 使用 Cocos Creator 一键发布手机 QQ「玩一玩」 | ||
- The engine is responsible for adapting the __QQ Play__ platform, the user's game logic code does not require any additional modifications. | ||
- The __Cocos Creator__ editor provides a packaging process that can be directly published as a game that meets the __QQ Play__ specification. | ||
- Support remote __QQ__ resource loading, caching, and version control of cache resources for __QQ Play__ platform standard. | ||
|
||
**准备工作**: | ||
## Use __Cocos Creator__ to publish to __QQ Play__ with one-click. | ||
|
||
- 获取 Bricks 引擎工程(这个工程暂时不能对外公开,开发者可向腾讯申请 bitbucket 库读取权限) | ||
### Ready to work | ||
|
||
**发布流程**: | ||
Obtain the Bricks engine project (this project is temporarily unavailable, developers can apply to the __Cocos Creator__ engine team for internal testing, or directly apply to Tencent for bitbucket library read access) | ||
|
||
1、使用 Creator 打开需要发布的项目工程,在构建发布面板中选择 **QQ Play** 平台。`远程服务器地址` 选项,若有需要可自行设置。然后点击 **构建**。 | ||
### Publishing process | ||
|
||
**First**, use __Cocos Creator__ to open the project project you want to publish, and select __QQ Play__ platform in the __Build...__ panel. If necessary, you can set the `Remote server address` option. Then click on **Build**. | ||
|
||
![](./publish-qqplay/build.jpeg) | ||
|
||
构建完成后访问项目文件夹,在 build 目录下就会生成一个 qqplay 的发布包: | ||
After the build is complete, a __qqplay__ release package will be generated in the __build__ directory: | ||
|
||
![](./publish-qqplay/package.jpeg) | ||
|
||
2、将 qqplay 文件夹中的内容拷贝到 Bricks 引擎工程的 Res 文件夹中: | ||
**Second**, copy the contents of the __qqplay__ folder to the __Res__ folder of the Bricks Engine project: | ||
|
||
![](./publish-qqplay/paste.jpeg) | ||
|
||
3、打开 Bricks 引擎中的 Xcode 工程,就可以直接进行玩一玩的编译调试了。具体可查看 [Bricks 引擎官方调试文档](http://hudong.qq.com/docs/engine/debug/intro.html)。 | ||
|
||
与这篇文档搭配的还有一段教学视频,可以结合视频中的操作来理解,更加直观。 | ||
|
||
{% raw %} | ||
|
||
<iframe frameborder="0" width="100%" height="440" src="https://v.qq.com/iframe/player.html?vid=m055288q7cl&tiny=0&auto=0" allowfullscreen></iframe> | ||
|
||
{% endraw %} | ||
**Third**, open the Xcode project in the Bricks engine, you can compile and debug the __QQ Play__ game directly, see the [Bricks Engine Official Debugging Document](https://hudong.qq.com/docs/engine/debug/intro.html). | ||
|
||
<br> | ||
**Note:** there is also a [teaching video](https://v.qq.com/iframe/player.html?vid=m055288q7cl&tiny=0&auto=0) that can be used alongside this document. | ||
|
||
## QQ「玩一玩」已知问题: | ||
## __QQ Play__ Known issues | ||
|
||
目前暂时仅支持在 Mac 上使用 Xcode 进行编译开发。<br> | ||
此外,我们对 QQ「玩一玩」的适配工作还未完全结束,目前仍不支持以下模块: | ||
Currently, only Xcode is used for compiling and developing on Mac. In addition, our adaptation of __QQ Play__ has not been completely completed, and the following modules are still not supported: | ||
|
||
- Label:不支持 TTF,系统字体也只能使用默认字体 | ||
- 粒子系统:不支持 plist 中存储贴图数据,只支持贴图 URL | ||
- Label: TTF is not supported, and system fonts can only use default fonts. | ||
- Particle system: Does not support storing texture data in plist, only supports texture URL | ||
- WebView | ||
- VideoPlayer | ||
- DeviceMotion | ||
|
||
以上功能预计在以后的更新中会逐步支持,我们也将持续与 QQ「玩一玩」工程师们紧密沟通,不断优化适配效果。 | ||
The above functions are expected to be gradually supported in future updates, and we will continue to communicate closely with __QQ Play__ engineers to continuously optimize the adaptation effect. | ||
|
||
## 接入注意事项: | ||
## Access Notes | ||
|
||
- 首包必须在 10M 以内,后续的资源可以部署在腾讯 CDN 上用 https 进行加载。 | ||
- 上线前需要软件著作权,并提供版号申请证明,回执或者受理截图。 | ||
- 除腾讯工作室外开发的游戏外,名称不允许出现 QQ、腾讯、天天、全民、欢乐等官方字眼。 | ||
- 游戏必须有自己的大厅,大厅需要具备开始游戏(含邀请好友)、道具商城、活动入口。 | ||
- 游戏内需要具备分享至 QQ 好友 / QQ 空间的能力。 | ||
- 游戏需要使用自建后台,必须接 openkey 鉴权。 | ||
- The first package must be within 10MB, and subsequent resources can be deployed on the __Tencent CDN__ using https for loading. | ||
- Software copyright is required before going online, and proof of application number, receipt or receipt of screenshots is provided. | ||
- Except for the games developed by Tencent Studios, the official names such as QQ, Tencent, Everyday, All People, and Joy are not allowed. | ||
- The game must have its own hall. The lobby needs to have a start game (including inviting friends), an item store, and an event entrance. | ||
- The ability to share to QQ friends / QQ space is required in the game. | ||
- The game needs to use the self-built background and must be connected to openkey authentication. | ||
|
||
## 参考链接 | ||
## Reference link | ||
|
||
更多内容可参考 [QQ「玩一玩」官方文档](https://hudong.qq.com/docs/access/)。 | ||
For more details, please refer to [QQ Play official documentation](https://hudong.qq.com/docs/access/). |
Oops, something went wrong.