@realsee/dnalogel 2.9.2 → 2.10.0
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.
- package/dist/PanoVideoPlugin/Controller.d.ts +31 -0
- package/dist/PanoVideoPlugin/VideoMeshController.d.ts +85 -0
- package/dist/PanoVideoPlugin/index.d.ts +16 -0
- package/dist/PanoVideoPlugin/typings.d.ts +64 -0
- package/dist/PanoVideoPlugin/utils/shader.d.ts +2 -0
- package/dist/base/BasePlugin.d.ts +6 -6
- package/dist/index.cjs.js +66 -46
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3161 -2923
- package/dist/index.umd.js +53 -33
- package/docs/assets/search.js +1 -1
- package/docs/classes/CSS3DRender.html +32 -31
- package/docs/classes/CruisePluginController.html +25 -24
- package/docs/classes/Magnifier.html +21 -20
- package/docs/classes/ModelRoomLabelController.html +12 -11
- package/docs/classes/Object3DHelperController.html +25 -24
- package/docs/classes/PaintBrush.html +16 -15
- package/docs/classes/PanoMeasurePluginLine.html +24 -23
- package/docs/classes/PanoMeasurePluginModel.html +23 -22
- package/docs/classes/PanoMeasurePluginPoint.html +15 -14
- package/docs/classes/PanoMeasurePluginPolyline.html +27 -26
- package/docs/classes/PanoTagPluginController.html +48 -47
- package/docs/classes/Util.BetterTween.html +9 -8
- package/docs/classes/Util.FivePointSelector.html +13 -12
- package/docs/classes/Util.Interval.html +13 -12
- package/docs/classes/Util.Magnifier.html +18 -17
- package/docs/classes/Util.PointDomHelper.html +12 -11
- package/docs/classes/Util.PointHelper.html +12 -11
- package/docs/classes/Util.Rectangle.html +14 -13
- package/docs/enums/CameraMovementEffect.html +8 -7
- package/docs/enums/ContentType.html +20 -19
- package/docs/enums/DIRECTION.html +10 -9
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +10 -9
- package/docs/enums/DimensionType.html +8 -7
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +9 -8
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +10 -9
- package/docs/enums/PaintBrushTypeEnum.html +9 -8
- package/docs/enums/PointType.html +8 -7
- package/docs/enums/Rotation.html +9 -8
- package/docs/functions/CSS3DRenderPlugin.html +8 -4
- package/docs/functions/CameraMovementPlugin.html +8 -4
- package/docs/functions/CruisePlugin.html +8 -4
- package/docs/functions/GuideLinePlugin.html +9 -5
- package/docs/functions/ItemLabelPlugin.html +8 -4
- package/docs/functions/MapviewFloorplanPlugin.html +8 -4
- package/docs/functions/ModelChassisCompassPlugin.html +8 -4
- package/docs/functions/ModelEntryDoorGuidePlugin.html +8 -4
- package/docs/functions/ModelFloorplanPlugin.html +8 -4
- package/docs/functions/ModelItemLabelPlugin.html +8 -4
- package/docs/functions/ModelRoomLabelPlugin.html +8 -4
- package/docs/functions/ModelTVVideoPlugin.html +8 -4
- package/docs/functions/ModelViewPlugin.html +8 -4
- package/docs/functions/Object3DHelperPlugin.html +8 -4
- package/docs/functions/PanoCompassPlugin.html +8 -4
- package/docs/functions/PanoCursorRaycasterPlugin.html +8 -4
- package/docs/functions/PanoDoorLabelPlugin.html +8 -4
- package/docs/functions/PanoFloorplanRadarPlugin.html +8 -4
- package/docs/functions/PanoMeasurePlugin.html +8 -4
- package/docs/functions/PanoRulerPlugin.html +8 -4
- package/docs/functions/PanoRulerProPlugin.html +8 -4
- package/docs/functions/PanoSpatialTagPlugin.html +8 -4
- package/docs/functions/PanoTagPlugin.html +8 -4
- package/docs/functions/PanoVideoPlugin.html +284 -0
- package/docs/functions/TopviewFloorplanPlugin.html +8 -4
- package/docs/functions/Util.getCoordsFromClient.html +6 -5
- package/docs/functions/Util.getCoordsFromElement.html +6 -5
- package/docs/functions/Util.getFrameTime.html +6 -5
- package/docs/functions/Util.getIntersectFromRelativePosition.html +6 -5
- package/docs/functions/Util.getRaycasterFromFivePointer.html +6 -5
- package/docs/functions/Util.isNil.html +6 -5
- package/docs/functions/Util.nextFrame.html +6 -5
- package/docs/functions/Util.notNil.html +6 -5
- package/docs/functions/Util.requestAnimationFrameInterval.html +6 -5
- package/docs/functions/Util.tweenProgress.html +6 -5
- package/docs/functions/pluginFlag.html +9 -5
- package/docs/index.html +8 -4
- package/docs/interfaces/AddTagConfig.html +7 -6
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +12 -11
- package/docs/interfaces/CSS3DRenderPluginState.html +9 -8
- package/docs/interfaces/CameraMovementPluginExportType.html +8 -7
- package/docs/interfaces/EventMap.html +16 -15
- package/docs/interfaces/FloorplanBounding.html +9 -8
- package/docs/interfaces/FloorplanData.html +11 -10
- package/docs/interfaces/FloorplanEntrance.html +12 -11
- package/docs/interfaces/FloorplanExtraObject.html +11 -10
- package/docs/interfaces/FloorplanExtraObject3D.html +9 -8
- package/docs/interfaces/FloorplanFloorData.html +10 -9
- package/docs/interfaces/FloorplanImagePosition.html +8 -7
- package/docs/interfaces/FloorplanObserver.html +10 -9
- package/docs/interfaces/FloorplanOutlineItem.html +10 -9
- package/docs/interfaces/FloorplanPosition.html +8 -7
- package/docs/interfaces/FloorplanRoomItem.html +14 -13
- package/docs/interfaces/FloorplanRoomLabelItem.html +8 -7
- package/docs/interfaces/FloorplanServerBounding.html +9 -8
- package/docs/interfaces/FloorplanServerComputedData.html +11 -10
- package/docs/interfaces/FloorplanServerData.html +8 -7
- package/docs/interfaces/FloorplanServerDoorItem.html +11 -10
- package/docs/interfaces/FloorplanServerDoorPosition.html +9 -8
- package/docs/interfaces/FloorplanServerEntrance.html +12 -11
- package/docs/interfaces/FloorplanServerFloorData.html +10 -9
- package/docs/interfaces/FloorplanServerImagePosition.html +8 -7
- package/docs/interfaces/FloorplanServerObserver.html +10 -9
- package/docs/interfaces/FloorplanServerOutlineItem.html +10 -9
- package/docs/interfaces/FloorplanServerPosition.html +8 -7
- package/docs/interfaces/FloorplanServerRoomItem.html +15 -14
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +8 -7
- package/docs/interfaces/HelperOffset.html +9 -8
- package/docs/interfaces/ItemLabelPluginData.html +7 -6
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +12 -11
- package/docs/interfaces/ItemLabelPluginParametersType.html +10 -9
- package/docs/interfaces/MinMax.html +8 -7
- package/docs/interfaces/ModelChassisCompassPluginData.html +8 -7
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +9 -8
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +8 -7
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +9 -8
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +9 -8
- package/docs/interfaces/ModelItemLabelPluginData.html +7 -6
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +12 -11
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +8 -7
- package/docs/interfaces/ModelRoomLabelPluginData.html +7 -6
- package/docs/interfaces/ModelTVVideoPluginData.html +10 -9
- package/docs/interfaces/ModelTVVideoPluginExportType.html +9 -8
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +7 -6
- package/docs/interfaces/ModelViewPluginExportType.html +12 -11
- package/docs/interfaces/Object3DHelperState.html +9 -8
- package/docs/interfaces/ObjectHelperControllers.html +10 -9
- package/docs/interfaces/PaintBrushAction.html +13 -12
- package/docs/interfaces/PaintBrushConfigs.html +13 -12
- package/docs/interfaces/PaintBrushState.html +11 -10
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +11 -10
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +9 -5
- package/docs/interfaces/PanoMeasureParameterType.html +13 -12
- package/docs/interfaces/PanoMeasurePluginLineJson.html +9 -8
- package/docs/interfaces/PanoMeasurePluginOpenParameter.html +8 -7
- package/docs/interfaces/PanoMeasurePluginPointJson.html +8 -7
- package/docs/interfaces/PanoMeasurePluginPolylineJson.html +9 -8
- package/docs/interfaces/PanoRulerPluginExportType.html +11 -10
- package/docs/interfaces/PanoRulerPluginOptions.html +8 -7
- package/docs/interfaces/PanoRulerPluginParameterType.html +9 -8
- package/docs/interfaces/PanoRulerProPluginExportType.html +10 -9
- package/docs/interfaces/PanoRulerProPluginOptions.html +8 -7
- package/docs/interfaces/PanoRulerProPluginParameterType.html +8 -7
- package/docs/interfaces/PanoRulerProPluginState.html +9 -8
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +9 -5
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +9 -5
- package/docs/interfaces/PanoSpatialTagPluginData.html +12 -11
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +11 -10
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +14 -13
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +11 -10
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +14 -13
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +12 -11
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +11 -10
- package/docs/interfaces/PanoVideoPluginType.LoadParams.html +74 -0
- package/docs/interfaces/PanoVideoPluginType.PanoVideoItem.html +89 -0
- package/docs/interfaces/PanoVideoPluginType.PluginData.html +66 -0
- package/docs/interfaces/PanoVideoPluginType.PluginEventMap.html +165 -0
- package/docs/interfaces/PanoVideoPluginType.PluginState.html +66 -0
- package/docs/interfaces/PanoVideoPluginType.VideoItem.html +97 -0
- package/docs/interfaces/PanoVideoPluginType.VideoMeshParams.html +114 -0
- package/docs/interfaces/Point.html +9 -8
- package/docs/interfaces/Room.html +10 -9
- package/docs/interfaces/RoomInfo.html +8 -7
- package/docs/interfaces/RoomLabel.html +15 -14
- package/docs/interfaces/RoomRules.html +9 -5
- package/docs/interfaces/Rooms.html +9 -5
- package/docs/interfaces/Scissor.html +10 -9
- package/docs/interfaces/State.html +9 -8
- package/docs/interfaces/TagCache.html +13 -12
- package/docs/interfaces/TagConfig.html +11 -10
- package/docs/interfaces/TagIconUrl.html +10 -9
- package/docs/interfaces/Tags.html +10 -9
- package/docs/interfaces/TemporaryState.html +7 -6
- package/docs/interfaces/Util.MagnifierParameter.html +12 -11
- package/docs/interfaces/Util.MouseGroupParameter.html +9 -8
- package/docs/modules/PanoVideoPluginType.html +62 -0
- package/docs/modules/Util.html +6 -5
- package/docs/modules.html +13 -5
- package/docs/types/ArrayPosition.html +9 -5
- package/docs/types/AudioAppearance.html +9 -5
- package/docs/types/AudioTagTypeConfigKey.html +9 -5
- package/docs/types/CSS3DRenderExportType.html +9 -5
- package/docs/types/CSS3DRenderPluginExportType.html +9 -5
- package/docs/types/CSS3DRenderPluginParameterType.html +9 -5
- package/docs/types/ClassFunctionParameters.html +9 -5
- package/docs/types/Color.html +9 -5
- package/docs/types/ContentTypeConfigKey.html +9 -5
- package/docs/types/ContentTypeConfigKeySplit.html +9 -5
- package/docs/types/ContentTypeMap.html +9 -5
- package/docs/types/Create3DDomContainerReturnType.html +9 -5
- package/docs/types/Create3DElementReturnType.html +9 -5
- package/docs/types/CruisePluginExportType.html +9 -5
- package/docs/types/Direction-1.html +9 -5
- package/docs/types/Direction4.html +9 -5
- package/docs/types/FloorplanRuleLabels.html +9 -5
- package/docs/types/FloorplanServerRuleLabels.html +9 -5
- package/docs/types/GuideLinePluginExportType.html +9 -5
- package/docs/types/HelperEventMap.html +9 -5
- package/docs/types/LoadTagConfig.html +9 -5
- package/docs/types/MapviewFloorplanPluginParameterType.html +9 -5
- package/docs/types/MapviewFloorplanPluginReturnType.html +9 -5
- package/docs/types/MediaData.html +9 -5
- package/docs/types/MediaStore.html +9 -5
- package/docs/types/ModelElement.html +9 -5
- package/docs/types/ModelEntryDoorGuidePluginParameterType.html +9 -5
- package/docs/types/ModelFloorplanPluginParameterType.html +9 -5
- package/docs/types/ModelFloorplanPluginReturnType.html +9 -5
- package/docs/types/ModelRoomLabelPluginParameters.html +9 -5
- package/docs/types/ModelRoomLabelPluginReturnType.html +9 -5
- package/docs/types/MoveArgs.html +9 -5
- package/docs/types/MoveOpts.html +9 -5
- package/docs/types/Object3DHelperEventMap.html +9 -5
- package/docs/types/ObjectFit.html +9 -5
- package/docs/types/PaintBrushEventMap.html +9 -5
- package/docs/types/PanoCompassPluginData.html +9 -5
- package/docs/types/PanoCompassPluginExportType.html +9 -5
- package/docs/types/PanoCompassPluginParameterType.html +9 -5
- package/docs/types/PanoFloorplanRadarPluginParameterType.html +9 -5
- package/docs/types/PanoFloorplanRadarPluginReturnType.html +9 -5
- package/docs/types/PanoIndex.html +9 -5
- package/docs/types/PanoMeasurePluginEvent.html +9 -5
- package/docs/types/PanoMeasureReturnType.html +9 -5
- package/docs/types/PanoSpatialTagPluginId.html +9 -5
- package/docs/types/PanoTagPluginExportInterface.html +9 -5
- package/docs/types/PanoTagPluginParamsInterface.html +9 -5
- package/docs/types/PanoVideoPluginParameterType.html +265 -0
- package/docs/types/PanoVideoPluginReturnType.html +265 -0
- package/docs/types/PlaneTag.html +9 -5
- package/docs/types/PlaneTagElement.html +9 -5
- package/docs/types/Point2DElement.html +9 -5
- package/docs/types/Point2DTag.html +9 -5
- package/docs/types/Point3DElement.html +9 -5
- package/docs/types/Point3DTag.html +9 -5
- package/docs/types/PointTag.html +9 -5
- package/docs/types/PointTagElement.html +9 -5
- package/docs/types/Position.html +9 -5
- package/docs/types/RotateArgs.html +9 -5
- package/docs/types/RotateOpts.html +9 -5
- package/docs/types/RuleLabelsKey.html +9 -5
- package/docs/types/RuleLabelsValue.html +9 -5
- package/docs/types/StickType.html +9 -5
- package/docs/types/Tag.html +9 -5
- package/docs/types/Tag2D.html +9 -5
- package/docs/types/Tag3D.html +9 -5
- package/docs/types/TagContentType.html +9 -5
- package/docs/types/TagDimensionType.html +9 -5
- package/docs/types/TagElement.html +9 -5
- package/docs/types/TagEvents.html +9 -5
- package/docs/types/TagGLTFObject.html +9 -5
- package/docs/types/TagHooks.html +9 -5
- package/docs/types/TagIconSize.html +9 -5
- package/docs/types/TagId.html +9 -5
- package/docs/types/TagPointType.html +9 -5
- package/docs/types/TopviewFloorplanPluginParameterType.html +9 -5
- package/docs/types/TopviewFloorplanPluginReturnType.html +9 -5
- package/docs/types/WorkCode.html +9 -5
- package/docs/variables/FLOOR_TYPE_MAP.html +9 -5
- package/docs/variables/PLUGIN.html +9 -5
- package/docs/variables/ROOM_FETILE_TYPE_MAP.html +9 -5
- package/docs/variables/ROOM_TYPE_MAP.html +9 -5
- package/docs/variables/VERSION.html +9 -5
- package/docs/variables/itemLabelPluginServerParams.html +9 -5
- package/docs/variables/modelItemLabelPluginServerParams.html +9 -5
- package/docs/variables/modelRoomLabelPluginServerParams.html +9 -5
- package/libs/PanoVideoPlugin/Controller.d.ts +31 -0
- package/libs/PanoVideoPlugin/Controller.js +127 -0
- package/libs/PanoVideoPlugin/VideoMeshController.d.ts +85 -0
- package/libs/PanoVideoPlugin/VideoMeshController.js +152 -0
- package/libs/PanoVideoPlugin/index.d.ts +16 -0
- package/libs/PanoVideoPlugin/index.js +31 -0
- package/libs/PanoVideoPlugin/typings/index.js +6 -0
- package/libs/PanoVideoPlugin/typings.d.ts +64 -0
- package/libs/PanoVideoPlugin/typings.js +1 -0
- package/libs/PanoVideoPlugin/utils/shader.d.ts +2 -0
- package/libs/PanoVideoPlugin/utils/shader.js +25 -0
- package/libs/base/BasePlugin.d.ts +6 -6
- package/libs/index.d.ts +1 -0
- package/libs/index.js +107 -100
- package/package.json +1 -1
- package/libs/PanoTagPlugin/mocks/v1/mock-80P6A03eQRQKY3oqLj.d.ts +0 -4
- package/libs/PanoTagPlugin/mocks/v1/mock-80P6A03eQRQKY3oqLj.js +0 -6
- package/libs/PanoTagPlugin/mocks/v1/mock-80QG2vMPboNv5DWrom.d.ts +0 -93
- package/libs/PanoTagPlugin/mocks/v1/mock-80QG2vMPboNv5DWrom.js +0 -5622
- package/libs/PanoTagPlugin/mocks/v1/mock-test3-realsee-cn-4zr0A5.js +0 -1325
- package/libs/PanoTagPlugin/mocks/v1/mock1.d.ts +0 -173
- package/libs/PanoTagPlugin/mocks/v1/mock1.js +0 -122
- package/libs/PanoTagPlugin/mocks/v1/mock2.d.ts +0 -233
- package/libs/PanoTagPlugin/mocks/v1/mock2.js +0 -296
- package/libs/PanoTagPlugin/mocks/v1/mock3.d.ts +0 -22
- package/libs/PanoTagPlugin/mocks/v1/mock3.js +0 -32
- package/libs/PanoTagPlugin/mocks/v1/mock4.d.ts +0 -56
- package/libs/PanoTagPlugin/mocks/v1/mock4.js +0 -60
- package/libs/PanoTagPlugin/mocks/v1/mock5.d.ts +0 -13
- package/libs/PanoTagPlugin/mocks/v1/mock5.js +0 -17
- package/libs/PanoTagPlugin/mocks/v1/mock6.d.ts +0 -16
- package/libs/PanoTagPlugin/mocks/v1/mock6.js +0 -27
- package/libs/PanoTagPlugin/mocks/v1/mock7.d.ts +0 -22
- package/libs/PanoTagPlugin/mocks/v1/mock7.js +0 -228
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Five } from '@realsee/five';
|
|
2
|
+
import type { LoadParams, PluginEventMap, PluginState, PluginData, VideoItem } from './typings';
|
|
3
|
+
import * as BasePlugin from '../base/BasePlugin';
|
|
4
|
+
export declare class PanoVideoPluginController extends BasePlugin.Controller<PluginState, PluginEventMap> {
|
|
5
|
+
/** 插件 State */
|
|
6
|
+
get state(): {
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
};
|
|
9
|
+
/** 插件是否已被销毁 */
|
|
10
|
+
get disposed(): boolean;
|
|
11
|
+
private enabled;
|
|
12
|
+
private controllerMap;
|
|
13
|
+
private _disposed;
|
|
14
|
+
constructor(five: Five);
|
|
15
|
+
/** 加载点位视频数据,加载数据并不代表会加载点位视频。 */
|
|
16
|
+
load(data: PluginData, params?: LoadParams): void;
|
|
17
|
+
/** 开启插件功能。 */
|
|
18
|
+
enable(options?: BasePlugin.BaseOptions): void;
|
|
19
|
+
/** 禁用插件功能。 */
|
|
20
|
+
disable(options?: BasePlugin.BaseOptions): void;
|
|
21
|
+
/** 为一个点位添加视频(可以是多条)。 */
|
|
22
|
+
add(panoIndex: number, videoItems: VideoItem[]): void;
|
|
23
|
+
/** 根据 VideoItem render_id 删除某个视频。 */
|
|
24
|
+
removeByRenderID(id: string): void;
|
|
25
|
+
/** 清空现有数据 */
|
|
26
|
+
clear(): void;
|
|
27
|
+
/** 销毁插件 */
|
|
28
|
+
dispose(): void;
|
|
29
|
+
/** 控制台打印警告 */
|
|
30
|
+
private logWarning;
|
|
31
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { Five } from '@realsee/five';
|
|
2
|
+
import type { VideoMeshParams } from './typings';
|
|
3
|
+
/** 点位视频控制器
|
|
4
|
+
* @description 控制器存在副作用,包括:
|
|
5
|
+
* - 对 Five 事件的监听。
|
|
6
|
+
* - 对 DOM 原生事件的监听。
|
|
7
|
+
* - 用于播放视频的模型。
|
|
8
|
+
* - 视频实例。
|
|
9
|
+
* @description 清除副作用的力度从弱到强:
|
|
10
|
+
* - 隐藏:hide,用于隐藏 UI 元素;不销毁多媒体资源。用于临时隐藏。
|
|
11
|
+
* - 取消挂载:unmount,销毁视频资源;移除模型。用于不符合自身展示条件时执行。
|
|
12
|
+
* - 禁用:disable,销毁视频资源;移除模型;取消监听。用于外部条件变换导致的功能禁用。
|
|
13
|
+
* - 销毁:dispose,用于彻底销毁实例,dispose 之后将不响应任何事件。
|
|
14
|
+
*/
|
|
15
|
+
export declare class VideoMeshController {
|
|
16
|
+
/** 传入的 ID,不可更改 */
|
|
17
|
+
get renderID(): string;
|
|
18
|
+
/** 是否已经销毁 */
|
|
19
|
+
get disposed(): boolean;
|
|
20
|
+
/** 是否已经启用 */
|
|
21
|
+
get enabled(): boolean;
|
|
22
|
+
private _id;
|
|
23
|
+
/** 视频资源地址 */
|
|
24
|
+
private url;
|
|
25
|
+
/** Five Instance */
|
|
26
|
+
private five;
|
|
27
|
+
/** 视频对应的点位 */
|
|
28
|
+
private panoIndex;
|
|
29
|
+
/** 视频在球面的 uv:[left, top, width, height] */
|
|
30
|
+
private origin;
|
|
31
|
+
/** Video DOM */
|
|
32
|
+
private video;
|
|
33
|
+
/** Video Mesh */
|
|
34
|
+
private videoMesh;
|
|
35
|
+
private _enabled;
|
|
36
|
+
private _disposed;
|
|
37
|
+
/** 视频是否曾经播放过 */
|
|
38
|
+
private hasVideoEverPlayed;
|
|
39
|
+
/** 自动 render five 的销毁函数
|
|
40
|
+
* @remark 由于 render video 依赖 Five render,因此需要自动 render five。
|
|
41
|
+
*/
|
|
42
|
+
private renderFiveDisposer?;
|
|
43
|
+
/** 初始化视频、模型以及相关事件监听。 */
|
|
44
|
+
constructor(five: Five, params: VideoMeshParams);
|
|
45
|
+
/** 彻底销毁,不响应之后的任何事件 */
|
|
46
|
+
dispose(): void;
|
|
47
|
+
enable(): void;
|
|
48
|
+
/** 禁用插件 */
|
|
49
|
+
disable(): void;
|
|
50
|
+
/** 添加时间监听 */
|
|
51
|
+
private addEventListeners;
|
|
52
|
+
/** 移除事件监听 */
|
|
53
|
+
private removeEventListeners;
|
|
54
|
+
/** 如果满足 mount 条件,mount */
|
|
55
|
+
private mountIfNeeded;
|
|
56
|
+
/** 挂载:加载视频资源;添加模型。 */
|
|
57
|
+
private mount;
|
|
58
|
+
/** 卸载:销毁视频资源;移除模型。 */
|
|
59
|
+
private unmount;
|
|
60
|
+
/** 暂停视频,去除模型。 */
|
|
61
|
+
private hide;
|
|
62
|
+
/** Five 数据加载后需要根据点位位姿调整点位模型位置 */
|
|
63
|
+
private onFiveDataLoaded;
|
|
64
|
+
/** 兼容视频播放 */
|
|
65
|
+
private onFiveWantsMoveToPano;
|
|
66
|
+
/** 走到某个点位上时,挂载/卸载视频 */
|
|
67
|
+
private onFivePanoArrived;
|
|
68
|
+
private onFivePanoWillArrive;
|
|
69
|
+
/** Five 模型变化 */
|
|
70
|
+
private onFiveModeChange;
|
|
71
|
+
/** Five mode change 动画结束 */
|
|
72
|
+
private onFiveInitAnimationEnded;
|
|
73
|
+
/** video playing 事件触发
|
|
74
|
+
* @remarks
|
|
75
|
+
* 事件触发时机:
|
|
76
|
+
* - video is ready to start after having been paused.
|
|
77
|
+
* - video is ready to play after delayed due to lack of data.
|
|
78
|
+
* @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video
|
|
79
|
+
*/
|
|
80
|
+
private onVideoPlaying;
|
|
81
|
+
/** video pause 事件触发 */
|
|
82
|
+
private onVideoPaused;
|
|
83
|
+
/** 控制台打印警告 */
|
|
84
|
+
private logWarning;
|
|
85
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FivePlugin } from '@realsee/five';
|
|
2
|
+
import { PanoVideoPluginController } from './Controller';
|
|
3
|
+
import * as _PanoVideoPluginType from './typings';
|
|
4
|
+
/** 点位视频播放插件
|
|
5
|
+
* - 支持一次性加载多组数据。
|
|
6
|
+
* - 走到点位上时播放视频(可能是多个)。
|
|
7
|
+
* - 走出点位时销毁视频。
|
|
8
|
+
* - 允许动态开启和禁用功能。
|
|
9
|
+
* - 视频只能在全景模式且点位一致时才会播放。不满足条件会自动销毁。
|
|
10
|
+
* - 不做多媒体缓存,缓解内存占用。
|
|
11
|
+
*/
|
|
12
|
+
export declare const PanoVideoPlugin: FivePlugin<undefined, PanoVideoPluginController>;
|
|
13
|
+
export { _PanoVideoPluginType as PanoVideoPluginType };
|
|
14
|
+
export declare type PanoVideoPluginParameterType = undefined;
|
|
15
|
+
export declare type PanoVideoPluginReturnType = InstanceType<typeof PanoVideoPluginController>;
|
|
16
|
+
export default PanoVideoPlugin;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type * as BasePlugin from '../base/BasePlugin';
|
|
2
|
+
/** 单个视频元素 */
|
|
3
|
+
export interface VideoItem {
|
|
4
|
+
/** client render ID
|
|
5
|
+
* @remarks 为什么不用 id 作为唯一标识?
|
|
6
|
+
* - id 是后端生成的,而 render_id 是前端生成的,在编辑时为了保证在请求后端数据之前也能进行渲染,使用额外的 id 进行渲染。
|
|
7
|
+
* - 为了保证两端的数据一致性,插件里使用 render_id 作为唯一 ID。
|
|
8
|
+
*/
|
|
9
|
+
render_id: string;
|
|
10
|
+
/** 文件地址 */
|
|
11
|
+
url: string;
|
|
12
|
+
/** 算法处理的视频 uv 信息
|
|
13
|
+
* @description [left, top, width, height]
|
|
14
|
+
*/
|
|
15
|
+
origin: number[];
|
|
16
|
+
}
|
|
17
|
+
/** 点位视频元素 */
|
|
18
|
+
export interface PanoVideoItem {
|
|
19
|
+
/** client render ID */
|
|
20
|
+
render_id: string;
|
|
21
|
+
/** 视频播放点位 */
|
|
22
|
+
pano_index: number;
|
|
23
|
+
/** 视频列表 */
|
|
24
|
+
video_list: VideoItem[];
|
|
25
|
+
}
|
|
26
|
+
/** 点位视频模型参数 */
|
|
27
|
+
export interface VideoMeshParams {
|
|
28
|
+
/** client render ID */
|
|
29
|
+
renderID: string;
|
|
30
|
+
/** video 文件地址 */
|
|
31
|
+
url: string;
|
|
32
|
+
/** 算法处理的视频 uv 信息
|
|
33
|
+
* @description [left, top, width, height]
|
|
34
|
+
*/
|
|
35
|
+
origin: number[];
|
|
36
|
+
/** 视频播放点位 */
|
|
37
|
+
panoIndex: number;
|
|
38
|
+
/** 初始状态 */
|
|
39
|
+
initialState?: {
|
|
40
|
+
enabled?: boolean;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/** 加载数据时的额外参数 */
|
|
44
|
+
export interface LoadParams {
|
|
45
|
+
initialState?: {
|
|
46
|
+
enabled?: boolean;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export interface PluginState {
|
|
50
|
+
enabled: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface PluginData {
|
|
53
|
+
list: PanoVideoItem[];
|
|
54
|
+
}
|
|
55
|
+
export interface PluginEventMap extends BasePlugin.EventMap<PluginState> {
|
|
56
|
+
/** 点位视频模型开启 */
|
|
57
|
+
enable: (params: {
|
|
58
|
+
userAction: boolean;
|
|
59
|
+
}) => void;
|
|
60
|
+
/** 点位视频模型关闭 */
|
|
61
|
+
disable: (params: {
|
|
62
|
+
userAction: boolean;
|
|
63
|
+
}) => void;
|
|
64
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const vertexShader = "\nvarying vec2 vUv;\nvoid main() {\n vUv = uv;\n vec4 mvPosition = modelViewMatrix * vec4(position, 1);\n gl_Position = projectionMatrix * mvPosition;\n}\n";
|
|
2
|
+
export declare const fragmentShader = "\nuniform sampler2D map;\nuniform vec4 size;\nvarying vec2 vUv;\n\nvoid main() {\n vec2 uv = vec2((vUv.x - size[0]) / size[2], (vUv.y - size[1]) / size[3]);\n float a = 0.1;\n float transX = uv.x < a ? 1.0 / a * uv.x : (uv.x > (1.0 - a) ? 1.0 / a * (1.0 - uv.x) : 1.0);\n float transY = uv.y < a ? 1.0 / a * uv.y : (uv.y > (1.0 - a) ? 1.0 / a * (1.0 - uv.y) : 1.0);\n\tfloat match = (1.0 - step(0.5, abs(uv.x - 0.5))) * (1.0 - step(0.5, abs(uv.y - 0.5))) * (transX < transY ? transX : transY);\n gl_FragColor = vec4(texture2D(map, uv).xyz, match);\n}\n";
|
|
@@ -83,6 +83,12 @@ declare abstract class Controller<PluginState extends State, PluginEventMap exte
|
|
|
83
83
|
* 隐藏UI
|
|
84
84
|
*/
|
|
85
85
|
hide?(options?: BaseOptions): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* 设置state
|
|
88
|
+
* @param state 插件的目标状态
|
|
89
|
+
* @param options 配置项
|
|
90
|
+
*/
|
|
91
|
+
setState?(state: Partial<PluginState>, options?: BaseOptions): void;
|
|
86
92
|
/**
|
|
87
93
|
* 启用插件,让插件能够响应交互
|
|
88
94
|
*/
|
|
@@ -95,12 +101,6 @@ declare abstract class Controller<PluginState extends State, PluginEventMap exte
|
|
|
95
101
|
* 插件进行销毁
|
|
96
102
|
*/
|
|
97
103
|
abstract dispose(): void;
|
|
98
|
-
/**
|
|
99
|
-
* 设置state
|
|
100
|
-
* @param state 插件的目标状态
|
|
101
|
-
* @param options 配置项
|
|
102
|
-
*/
|
|
103
|
-
abstract setState(state: Partial<PluginState>, options?: BaseOptions): void;
|
|
104
104
|
}
|
|
105
105
|
export type { State, EventMap, BaseOptions };
|
|
106
106
|
export { Controller };
|