@realsee/vreo 0.2.0-alpha.5 → 0.2.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +47 -3
  2. package/docs/assets/custom.css +2 -2
  3. package/docs/assets/search.js +1 -1
  4. package/docs/classes/Player.Controller.html +3 -3
  5. package/docs/classes/Player.Player-1.html +3 -3
  6. package/docs/classes/Player.VideoAgentMesh.html +11 -11
  7. package/docs/classes/Player.VideoAgentScene.html +1 -1
  8. package/docs/enums/Player.InfoPanelStyleEnum.html +1 -0
  9. package/docs/enums/Player.InfoPanelTypeEnum.html +1 -1
  10. package/docs/enums/Player.PanoEffectEnum.html +1 -1
  11. package/docs/enums/Player.PanoTagEnum.html +1 -1
  12. package/docs/enums/Player.VreoKeyframeEnum.html +12 -12
  13. package/docs/enums/fivePlugins.CameraMovementEffect.html +1 -1
  14. package/docs/enums/fivePlugins.Rotation.html +1 -1
  15. package/docs/index.html +26 -2
  16. package/docs/interfaces/Player.CustomVreoKeyframeProps.html +1 -1
  17. package/docs/interfaces/Player.PlayerConfigs.html +3 -3
  18. package/docs/interfaces/Player.Vertex.html +1 -1
  19. package/docs/interfaces/Player.VideoAgentMeshOptions.html +1 -1
  20. package/docs/interfaces/Player.VreoKeyframe.html +1 -1
  21. package/docs/interfaces/Player.VreoUnit.html +1 -1
  22. package/docs/interfaces/Player.VreoVideo.html +1 -1
  23. package/docs/interfaces/fivePlugins.CameraMovementOptsCallback.html +1 -1
  24. package/docs/interfaces/fivePlugins.CameraMovementPluginExportType.html +2 -2
  25. package/docs/interfaces/fivePlugins.ModelTVVideoPluginData.html +1 -1
  26. package/docs/interfaces/fivePlugins.ModelTVVideoPluginExportType.html +1 -1
  27. package/docs/interfaces/fivePlugins.ModelTVVideoPluginParameterType.html +1 -1
  28. package/docs/interfaces/react.VreoActionCallbacks.html +6 -6
  29. package/docs/interfaces/react.VreoProviderProps.html +1 -1
  30. package/docs/modules/Player.html +13 -13
  31. package/docs/modules/custom.html +1 -1
  32. package/docs/modules/fivePlugins.html +2 -2
  33. package/docs/modules/react.html +1 -1
  34. package/lib/PlayController/createHTMLAudioElement.d.ts +1 -0
  35. package/lib/PlayController/createHTMLAudioElement.js +47 -0
  36. package/lib/PlayController/index.d.ts +38 -0
  37. package/lib/PlayController/index.js +300 -0
  38. package/lib/Player/Controller.d.ts +2 -0
  39. package/lib/Player/Controller.js +14 -0
  40. package/lib/Player/custom/SpatialScenePanel/index.d.ts +2 -2
  41. package/lib/Player/custom/SpatialScenePanel/index.js +96 -15
  42. package/lib/Player/index.d.ts +1 -1
  43. package/lib/Player/index.js +71 -10
  44. package/lib/Player/modules/PopUp/index.d.ts +2 -0
  45. package/lib/Player/modules/PopUp/index.js +43 -0
  46. package/lib/Player/modules/keyframes/CameraMovement/index.js +41 -5
  47. package/lib/Player/modules/keyframes/InfoPanel/index.js +73 -35
  48. package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +23 -15
  49. package/lib/Player/typings.d.ts +4 -0
  50. package/lib/fivePlugins/CameraMovementPlugin/index.js +101 -90
  51. package/lib/fivePlugins/CameraMovementPlugin/typings.d.ts +3 -2
  52. package/lib/typings/VreoUnit.d.ts +9 -3
  53. package/lib/typings/VreoUnit.js +14 -6
  54. package/package.json +2 -2
  55. package/resources/PlayController/createHTMLAudioElement.ts +53 -0
  56. package/resources/PlayController/index.ts +167 -0
  57. package/resources/Player/Controller.ts +12 -0
  58. package/resources/Player/custom/SpatialScenePanel/index.tsx +143 -34
  59. package/resources/Player/index.tsx +36 -2
  60. package/resources/Player/modules/PopUp/index.tsx +26 -0
  61. package/resources/Player/modules/keyframes/CameraMovement/index.tsx +7 -3
  62. package/resources/Player/modules/keyframes/InfoPanel/index.tsx +79 -34
  63. package/resources/Player/modules/keyframes/UpdateVRPanorama/index.tsx +20 -15
  64. package/resources/Player/typings.ts +2 -0
  65. package/resources/fivePlugins/CameraMovementPlugin/index.ts +55 -47
  66. package/resources/fivePlugins/CameraMovementPlugin/typings.ts +2 -1
  67. package/resources/typings/VreoUnit.ts +11 -4
  68. package/stylesheets/custom/SpatialScenePanel.css +14 -8
  69. package/stylesheets/default.css +66 -0
package/README.md CHANGED
@@ -243,7 +243,7 @@ ReactDOM.render(<App></App>, document.getElementById('app'))
243
243
  - `data`: 当前剧本帧类别数据依赖。
244
244
 
245
245
  > **如何获取剧本数据?**
246
- > 剧本服务及剧本编辑器公开版本尚在开发中,预计 2022 年 2 月份中旬发布,敬请期待。
246
+ > 剧本服务及剧本编辑器公开版本尚在开发中,敬请期待。
247
247
 
248
248
  ### 剧本帧说明
249
249
 
@@ -353,8 +353,23 @@ type PanoEffectData = {
353
353
 
354
354
  ```ts
355
355
  export type UpdateVRPanoramaData = {
356
- panoIndex: number // 点位
357
- images: WorkCubeImage // 全景贴图
356
+ _signature: string // 签名字段
357
+ allow_hosts: string[] // 域名白名单
358
+ certificate: string // 签名值
359
+ expire_at: string // 过期时间
360
+ // 动态场景
361
+ dynamic_scene?: {
362
+ images: { // 切换全景的图片
363
+ index: number // 对应的全景点位
364
+ right: string
365
+ left: string
366
+ up: string
367
+ down: string
368
+ front: string
369
+ back: string
370
+ }
371
+ }
372
+ [key: string]: any
358
373
  }
359
374
  ```
360
375
 
@@ -442,6 +457,8 @@ export function YourCustomKeyframe(props: CustomVreoKeyframeProps) {
442
457
 
443
458
  ## 注意事项
444
459
 
460
+ ### 兼容性
461
+
445
462
  浏览器对视频自动播放有严格的限制(播放行为必须由用户触发),`@realsee/vreo` 内部已经最大限度规避了浏览器对视频自动播放的限制。
446
463
 
447
464
  但是规避 [微信浏览器中音视频自动播放限制](https://developers.weixin.qq.com/community/develop/doc/000e640d77cfa001132a6cb8456c01) 需要调用 [微信 JS-SDK](https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html) 触发`WeixinJSBridgeReady`事件后才能实现。
@@ -485,6 +502,33 @@ const vreoplayer = new Player(five, {
485
502
 
486
503
  这样,在微信浏览器或微信小程序 `WebView` 中也能正常使用自动播效果。
487
504
 
505
+ ### 性能优化
506
+
507
+ 提高播放性能目前有两个策略:降低贴图分辨率和提前预载。
508
+
509
+ #### 降低图片分辨率
510
+
511
+ 可以设置 `five.imageOptions.size` 来降低渲染引擎的贴图尺寸,这样下载速度会变快且内存占用也会降低。
512
+ 你也可以配置 **Vreo** 参数来达到类似的效果:
513
+
514
+ ```ts
515
+ const vreoplayer = new Player(five, { imageOptions: { size: 1024 } })
516
+ ```
517
+
518
+ #### 自动预载
519
+
520
+ 如果网络不稳定,可以提前预载静态资源,这样播放过程中不会卡顿:
521
+
522
+ ```ts
523
+ // 全局预载
524
+ const vreoplayer = new Player(five, { autoPreload: true })
525
+
526
+ // 针对某一份剧本数据预载
527
+ vreoplayer.load(vreoUnit, 0, true)
528
+
529
+ ```
530
+
531
+
488
532
  ## API 文档
489
533
 
490
534
  详细的 API 文档请参考:[Vreo API](https://realsee-developer.github.io/vreo/index.html) 。
@@ -29,10 +29,10 @@ blockquote p {
29
29
  .hljs {
30
30
  background-color: transparent;
31
31
  font-family: monospace;
32
- font-size: 0.75rem;
32
+ font-size: 0.85rem;
33
33
  }
34
34
  code {
35
- font-size: 12px;
35
+ font-size: 14px;
36
36
  background-color: rgb(96 125 139 / 10%);
37
37
  }
38
38