Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpha #24

Open
wants to merge 98 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
b7491bb
feat(ui): 适配不同宽度的屏幕
Emiyaaaaa Oct 9, 2022
a6e18c4
build
Emiyaaaaa Oct 18, 2022
4305077
update version to 1.0.0-alpha.1
Emiyaaaaa Oct 18, 2022
51dd2b1
fix: build
Emiyaaaaa Oct 18, 2022
a3b378e
update version to 1.0.0-alpha.2
Emiyaaaaa Oct 18, 2022
ad38913
fix build
Emiyaaaaa Oct 18, 2022
2cfeec4
update version to 1.0.0-alpha.3
Emiyaaaaa Oct 18, 2022
33c42eb
fix build
Emiyaaaaa Oct 18, 2022
fa76d81
update version to 1.0.0-alpha.4
Emiyaaaaa Oct 18, 2022
b338b35
fix build
Emiyaaaaa Oct 18, 2022
7ddf905
update version to 1.0.0-alpha.5
Emiyaaaaa Oct 18, 2022
d2f65b9
update version to 1.0.0-alpha.6
Emiyaaaaa Oct 24, 2022
4a905a2
fix tag fold
Emiyaaaaa Oct 24, 2022
6eeb9a5
update version to 1.0.0-alpha.7
Emiyaaaaa Oct 24, 2022
1b2ff1b
change fontsize
Emiyaaaaa Oct 27, 2022
fc9d303
update version to 1.0.0-alpha.8
Emiyaaaaa Oct 27, 2022
1090f08
build
Emiyaaaaa Oct 27, 2022
04bfc8e
fix: wave url webm to mov
Emiyaaaaa Oct 28, 2022
6c43d7f
update version to 1.0.0-alpha.9
Emiyaaaaa Oct 28, 2022
c2df9d2
build
Emiyaaaaa Oct 28, 2022
4f4a450
fix: wave url
Emiyaaaaa Oct 28, 2022
b4fb474
update version to 1.0.0-alpha.10
Emiyaaaaa Oct 28, 2022
db2e042
fix
Emiyaaaaa Oct 28, 2022
09eaca4
update version to 1.0.0-alpha.11
Emiyaaaaa Oct 28, 2022
6a6e69a
update version to 1.0.0-alpha.12
Emiyaaaaa Oct 28, 2022
aee9637
update dna
Emiyaaaaa Nov 3, 2022
6acac98
build
Emiyaaaaa Nov 3, 2022
ce6e694
update version to 1.0.0-alpha.13
Emiyaaaaa Nov 3, 2022
b7faab7
update version to 1.0.0-alpha.14
Emiyaaaaa Nov 3, 2022
bc46d7d
feat: README
Emiyaaaaa Nov 7, 2022
6889802
update version to 1.0.0-alpha.16
Emiyaaaaa Nov 7, 2022
f95efc4
fix: mobx vreoAgnentMesh
Emiyaaaaa Nov 11, 2022
94e4d87
update version to 1.0.0-alpha.17
Emiyaaaaa Nov 11, 2022
58960e1
muti audio
Emiyaaaaa Nov 14, 2022
876f67d
build
Emiyaaaaa Nov 14, 2022
789a6c7
update version to 1.0.0-alpha.19
Emiyaaaaa Nov 14, 2022
c8b3ff2
fix
Emiyaaaaa Nov 14, 2022
1a5fae4
update version to 1.0.0-alpha.20
Emiyaaaaa Nov 14, 2022
68b251b
fix
Emiyaaaaa Nov 17, 2022
5a70789
update vreo version to alpha.21
Emiyaaaaa Nov 17, 2022
082a944
fix: muti audio play end
Emiyaaaaa Nov 22, 2022
b4583c2
update vreo version to alpha.22
Emiyaaaaa Nov 22, 2022
76be5f4
feat: muti audio play
Emiyaaaaa Nov 23, 2022
7a5441d
update vreo version to alpha.23
Emiyaaaaa Nov 23, 2022
a487961
fix
Emiyaaaaa Nov 24, 2022
66d8b2c
update vreo version to alpha.24
Emiyaaaaa Nov 24, 2022
c5d29dc
fix
Emiyaaaaa Nov 24, 2022
5a4bbb1
update vreo version to alpha.25
Emiyaaaaa Nov 24, 2022
10dd486
fix
Emiyaaaaa Nov 24, 2022
6863465
update vreo version to alpha.26
Emiyaaaaa Nov 24, 2022
51e7664
fix: audio
Emiyaaaaa Nov 30, 2022
c233773
update version to 1.0.0-alpha.27
Emiyaaaaa Nov 30, 2022
116ce0a
fix: audio
Emiyaaaaa Nov 30, 2022
550ef9b
build
Emiyaaaaa Nov 30, 2022
256ba8f
update version to 1.0.0-alpha.28
Emiyaaaaa Nov 30, 2022
29e2928
fix: audio
Emiyaaaaa Nov 30, 2022
4cdce28
update vreo version to 1.0.0-alpha.29
Emiyaaaaa Nov 30, 2022
b6d7864
update version to 1.0.0-alpha.30
Emiyaaaaa Dec 19, 2022
4bc428c
mv dna to peerdep
Emiyaaaaa Dec 19, 2022
5a2f789
build;
Emiyaaaaa Dec 19, 2022
6069d94
update version to 1.0.0-alpha.31
Emiyaaaaa Dec 19, 2022
b052301
fix mutiload audio
Emiyaaaaa Dec 19, 2022
47baf5e
update version to 1.0.0-alpha.32
Emiyaaaaa Dec 19, 2022
670d39e
peerdep
Emiyaaaaa Dec 27, 2022
5867a61
update version to 1.0.0-alpha.33
Emiyaaaaa Dec 27, 2022
55048cd
peerdep tweenjs
Emiyaaaaa Dec 27, 2022
a558aab
dev
Emiyaaaaa Jan 13, 2023
772b3da
fix: weixin autoplay info panel
Emiyaaaaa May 20, 2023
d464139
update version 34
Emiyaaaaa May 20, 2023
437631c
update version 1.2.0
Emiyaaaaa May 20, 2023
b6f2605
fix
Emiyaaaaa Jun 2, 2023
23adcaf
fix: vreo
Emiyaaaaa Jun 2, 2023
415441f
debug
Emiyaaaaa Jun 20, 2023
e42a588
2.0.0-alpha.0
Emiyaaaaa Jun 20, 2023
6d260ad
build
Emiyaaaaa Jun 20, 2023
178c6a5
feat: media Panel width
Emiyaaaaa Jul 24, 2023
42488fd
build
Emiyaaaaa Jul 24, 2023
e2eaacf
fix: audio
Emiyaaaaa Jul 24, 2023
c6d58a3
fix: ios video panel autoplay
Emiyaaaaa Jul 25, 2023
6b6a762
update vreo
Emiyaaaaa Jul 25, 2023
bd3529e
feat: fix custom keyframe type
Emiyaaaaa Aug 25, 2023
5d951b3
fix: type
Emiyaaaaa Aug 25, 2023
e44628f
fix: type
Emiyaaaaa Aug 25, 2023
06620ba
fix: camera move effect
Emiyaaaaa Aug 28, 2023
5e16107
fix: new Player
Emiyaaaaa Sep 5, 2023
dae2f33
fix: camera movement bug
Emiyaaaaa Sep 11, 2023
8131b9a
chore: cnpm async package after publish
Emiyaaaaa Sep 11, 2023
c4498e7
fix: videoEffect
Emiyaaaaa Sep 11, 2023
d380193
feat: 2.3.0 add config.waveStaticPrefix
Emiyaaaaa Sep 17, 2023
779700d
fix: prefix
Emiyaaaaa Sep 17, 2023
f10cee9
fix: vivo video panel
Emiyaaaaa Jan 8, 2024
c56da9c
fix: deps
Emiyaaaaa Jan 8, 2024
d40b1aa
fix: 2.3.5
Emiyaaaaa Jan 8, 2024
8428f30
fix: video config support videoPanel fields
Emiyaaaaa Mar 20, 2024
b507c9a
2.3.7: revert 2.3.5
Emiyaaaaa Mar 20, 2024
521fc49
add @babel/plugin-transform-runtime
Emiyaaaaa Apr 18, 2024
7406d6d
build
Emiyaaaaa Apr 18, 2024
f1a304f
fix: 兼容 five 6
Emiyaaaaa May 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/.pnp
.pnp.js
/.idea
/.vscode

# testing
/coverage
Expand Down
14 changes: 14 additions & 0 deletions .hintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": [
"development"
],
"hints": {
"no-inline-styles": "off",
"axe/text-alternatives": [
"default",
{
"image-alt": "off"
}
]
}
}
32 changes: 25 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,42 @@
# CHANGELOG
# 2.0.0
- fix: 重新实现了运镜功能,修复了运镜掉帧的问题
- break-change:修复了模型态切换全景态时的目标点位为0时,有可能不会真正移动到目标位置的问题。该问题的修复会导致之前的一些基于此bug制作的导览出现问题,需要重新制作。

#0.2.0-alpha.25
# 1.0.0-alpha.21
- fix: 多段BgMusic播放问题

# 1.0.0-alpha.19
- fix: 多段BgMusic可以重复播放

# 1.0.0-alpha.18
- fix: 修复无音频版本中途播放会从头开始的问题

# 1.0.0-alpha.1
- feat: css样式适配: 手机横竖屏, pad, pc
- feat: 新增两种波浪风格: 'wave' | 'solid'
- feat: 标签调用dna插件
- fix: 图片/视频 弹窗UI问题

# 0.2.0-alpha.25
- feat: rotate 不指定顺时针或者逆时针,则按照锐角交互。

#0.2.0-alpha.24
# 0.2.0-alpha.24
- fix: 修复 CSS3DRender 与插件库样式冲突问题。
- fix: 修复示例 wrapper 定位问题。

#0.2.0-alpha.23
# 0.2.0-alpha.23
- fix: 修复21版本针对非旋转运镜使用了旋转速度问题修复的代码丢失问题。

#0.2.0-alpha.22
# 0.2.0-alpha.22
- fix: 修复运镜顺时针逆时针反向问题。

#0.2.0-alpha.21
# 0.2.0-alpha.21
- fix: 修复非旋转运镜使用了旋转速度问题。

#0.2.0-alpha.20
# 0.2.0-alpha.20
- fix: 修复 `paused` 事件抛出 `ended` 回调带来的重复抛出事件问题。

#0.2.0-alpha.19
# 0.2.0-alpha.19
- feat: 新增 `getCurrentTime()` 方法,支持实时获取当前播放时间点;
- feat: 新增 `ended` 标识,当检测到 video 实例 `ended` 以后会在 `paused` 事件里抛出 `true` 回调。
82 changes: 46 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,53 +15,65 @@

## 安装说明

推荐使用 `npm` 或 `yarn` 的方式进行安装。由于 `@realsee/vreo` 依赖 [Five](https://unpkg.com/@realsee/five/docs/index.html) 和 [React](https://reactjs.org/) ,请务必同时安装相关依赖:

```bash
$ npm install @realsee/vreo @realsee/five react react-dom --save
# or
$ yarn add @realsee/vreo @realsee/five react react-dom
```
- 由于 `@realsee/vreo` 依赖 [Five](https://unpkg.com/@realsee/five/docs/index.html) 和 [React](https://reactjs.org/) ,请务必同时安装相关依赖
- 根据项目的包管理器来安装:
``` bash
# pnpm
pnpm install @realsee/vreo @realsee/five react react-dom --save
# npm
npm install @realsee/vreo @realsee/five react react-dom --save
# yarn
yarn add @realsee/vreo @realsee/five react react-dom
```

## 快速上手
引入样式:

```css
/* @file xxx.css */
@import '@realsee/vreo/stylesheets/default.css';
```
```jsx
/* @file xxx.tsx | xxx.jsx */
import '@realsee/vreo/stylesheets/default.css';
```
examples:
```tsx
/* @file index.tsx | index.jsx */
import * as React from 'react'
import { Five } from '@realsee/five'
import { Player } from '@realsee/vreo'
import '@realsee/vreo/stylesheets/default.css';

// 创建 Five 实例
const five = new Five({
/* Five 配置项 */
})

// 创建 Player 实例
const vreoplayer = new Player(five)
const vreoPlayer = new Player(five)

// 异步请求剧本数据
const vreoUnit = await fetch('api/**/**')

// 加载剧本数据(剧本数据见下文)
vreoplayer.load(vreoUnit)
vreoPlayer.load(vreoUnit)

// 播放
vreoplayer.play()
vreoPlayer.play()

// 暂停
vreoplayer.pause()
```

引入样式:

```css
@import '@realsee/vreo/stylesheets/default.css';
vreoPlayer.pause()
```

## React Context & Hooks 模式使用

**Vreo** 支持 [React Context](https://reactjs.org/docs/context.html) 与 [Hooks](https://reactjs.org/docs/hooks-intro.html) 相配合的模式使用,简单样例如下:

```jsx
```tsx
/* @file App.tsx */

import * as React from 'react'
import * as ReactDOM from 'react-dom'
import { Five, Work, parseWork } from '@realsee/five'
Expand All @@ -78,20 +90,21 @@ const PlayButton: React.FC = () => {
const { load, play, pause } = useVreoAction()

return (
<button
onClick={async () => {
// 获取讲房数据
const vreoUnit = await fetch('api/**/**')
// 载入数据
await load(vreoUnit)
// 播放
play()
// 暂停
pause()
}}
>
讲解
</button>
<>
<button
onClick={async () => {
// 获取讲房数据
const vreoUnit = await fetch('api/**/**')
// 载入数据
await load(vreoUnit)
// 播放
play()
}}
>
讲解
</button>
<button onClick={() => pause()}>暂停</button>
</>
)
}

Expand Down Expand Up @@ -559,7 +572,4 @@ vreoplayer.load(vreoUnit, 0, true)

```


## API 文档

详细的 API 文档请参考:[Vreo API](https://realsee.js.org/vreo/index.html) 。
Enjoy it!
39 changes: 37 additions & 2 deletions __test__/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,42 @@ import { unsafe__useFiveInstance, useFiveWork } from '@realsee/five/react'
import * as React from 'react'
import { Player } from '../resources/Player'
import { VreoUnit } from '../typedoc/Player'
import { data } from './data/vreo-units/vreo-unit-a'
// import { data } from './data/vreo-units/vreo-unit-a'

// import { data } from './data/vreo-units/vreo-XQeernmw'

// import { data } from './data/vreo-units/vreo-unit-test-video'

// 弹层视频
// import { data1 as data } from './data/vreo-units/vreo-unit-a'

import { data } from './data/vreo-units/vreo-unit-PjVVGxn2'

// 无视频版本
// import { data } from './data/vreo-units/vreo-unit-b'
//

// import { data } from './data/vreo-units/vreo-unit-tmp'

// 头像音频
// import { data } from './data/vreo-units/vreo-unit-b-avatar'


// 啥都没有版本
// import { data } from './data/vreo-units/vreo-unit-b-noaudio'

// import {data} from './data/vreo-units/vreo-unit-muti-audio-test'

// import {data} from './data/vreo-units/vreo-unit-taibao'

// import {data} from './data/vreo-units/vreo-unit-single-bgm'

// video effect
// import {data} from './data/vreo-units/vreo-unit-videoEffect'

// vivo 视频黑屏
// import {data} from './data/vreo-units/vreo-unit-o4bb0mxR'



enum PlayerState {
notReady = 'notReady',
Expand All @@ -17,6 +46,7 @@ enum PlayerState {
playing = 'playing',
}


export function App() {
const ref = React.useRef<Player>()
const five = unsafe__useFiveInstance()
Expand All @@ -27,15 +57,20 @@ export function App() {
const player = new Player(five)
ref.current = player
setState(PlayerState.ready)
player.on('loaded', () => console.log('loaded'))
player.on('paused', () => setState(PlayerState.paused))
player.on('playing', () => setState(PlayerState.playing))
player.on('ended', () => console.log('ended'))
player.on('playing', () => console.log('playing'))
player.on('paused', (ended) => console.log({ended}))
Object.assign(window, { $player: player })
}, [])

return (
<div className="btns">
<button
onClick={async () => {
console.log(1, Date.now())
if (state === PlayerState.ready) {
ref.current?.show()
await ref.current?.load(data as VreoUnit)
Expand Down
1 change: 1 addition & 0 deletions __test__/PlayController/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as React from 'react'
import ReactDOM from 'react-dom'
import { ResponsiveFullScreenFiveCanvas } from '../components/ResponsiveFullScreenFiveCanvas'
import work from './work.json'
// import work from '../data/works/XQeernmw.json'

import '../index.css'
import { App } from './App'
Expand Down
2 changes: 1 addition & 1 deletion __test__/data/midea/allhouse.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"duration": 81200,
"start": 0,
"end": 81200,
"url": "https://test-vr-public.realsee-cdn.com/vrframework/test/audio_merged/LEJhnm1R/aitalk_text/merged.mp4"
"url": "https://test-vr-public.realsee-cdn.cn/vrframework/test/audio_merged/LEJhnm1R/aitalk_text/merged.mp4"
},
"keyframes": [
{
Expand Down
Loading