@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.
- package/README.md +47 -3
- package/docs/assets/custom.css +2 -2
- package/docs/assets/search.js +1 -1
- package/docs/classes/Player.Controller.html +3 -3
- package/docs/classes/Player.Player-1.html +3 -3
- package/docs/classes/Player.VideoAgentMesh.html +11 -11
- package/docs/classes/Player.VideoAgentScene.html +1 -1
- package/docs/enums/Player.InfoPanelStyleEnum.html +1 -0
- package/docs/enums/Player.InfoPanelTypeEnum.html +1 -1
- package/docs/enums/Player.PanoEffectEnum.html +1 -1
- package/docs/enums/Player.PanoTagEnum.html +1 -1
- package/docs/enums/Player.VreoKeyframeEnum.html +12 -12
- package/docs/enums/fivePlugins.CameraMovementEffect.html +1 -1
- package/docs/enums/fivePlugins.Rotation.html +1 -1
- package/docs/index.html +26 -2
- package/docs/interfaces/Player.CustomVreoKeyframeProps.html +1 -1
- package/docs/interfaces/Player.PlayerConfigs.html +3 -3
- package/docs/interfaces/Player.Vertex.html +1 -1
- package/docs/interfaces/Player.VideoAgentMeshOptions.html +1 -1
- package/docs/interfaces/Player.VreoKeyframe.html +1 -1
- package/docs/interfaces/Player.VreoUnit.html +1 -1
- package/docs/interfaces/Player.VreoVideo.html +1 -1
- package/docs/interfaces/fivePlugins.CameraMovementOptsCallback.html +1 -1
- package/docs/interfaces/fivePlugins.CameraMovementPluginExportType.html +2 -2
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginData.html +1 -1
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginExportType.html +1 -1
- package/docs/interfaces/fivePlugins.ModelTVVideoPluginParameterType.html +1 -1
- package/docs/interfaces/react.VreoActionCallbacks.html +6 -6
- package/docs/interfaces/react.VreoProviderProps.html +1 -1
- package/docs/modules/Player.html +13 -13
- package/docs/modules/custom.html +1 -1
- package/docs/modules/fivePlugins.html +2 -2
- package/docs/modules/react.html +1 -1
- package/lib/PlayController/createHTMLAudioElement.d.ts +1 -0
- package/lib/PlayController/createHTMLAudioElement.js +47 -0
- package/lib/PlayController/index.d.ts +38 -0
- package/lib/PlayController/index.js +300 -0
- package/lib/Player/Controller.d.ts +2 -0
- package/lib/Player/Controller.js +14 -0
- package/lib/Player/custom/SpatialScenePanel/index.d.ts +2 -2
- package/lib/Player/custom/SpatialScenePanel/index.js +96 -15
- package/lib/Player/index.d.ts +1 -1
- package/lib/Player/index.js +71 -10
- package/lib/Player/modules/PopUp/index.d.ts +2 -0
- package/lib/Player/modules/PopUp/index.js +43 -0
- package/lib/Player/modules/keyframes/CameraMovement/index.js +41 -5
- package/lib/Player/modules/keyframes/InfoPanel/index.js +73 -35
- package/lib/Player/modules/keyframes/UpdateVRPanorama/index.js +23 -15
- package/lib/Player/typings.d.ts +4 -0
- package/lib/fivePlugins/CameraMovementPlugin/index.js +101 -90
- package/lib/fivePlugins/CameraMovementPlugin/typings.d.ts +3 -2
- package/lib/typings/VreoUnit.d.ts +9 -3
- package/lib/typings/VreoUnit.js +14 -6
- package/package.json +2 -2
- package/resources/PlayController/createHTMLAudioElement.ts +53 -0
- package/resources/PlayController/index.ts +167 -0
- package/resources/Player/Controller.ts +12 -0
- package/resources/Player/custom/SpatialScenePanel/index.tsx +143 -34
- package/resources/Player/index.tsx +36 -2
- package/resources/Player/modules/PopUp/index.tsx +26 -0
- package/resources/Player/modules/keyframes/CameraMovement/index.tsx +7 -3
- package/resources/Player/modules/keyframes/InfoPanel/index.tsx +79 -34
- package/resources/Player/modules/keyframes/UpdateVRPanorama/index.tsx +20 -15
- package/resources/Player/typings.ts +2 -0
- package/resources/fivePlugins/CameraMovementPlugin/index.ts +55 -47
- package/resources/fivePlugins/CameraMovementPlugin/typings.ts +2 -1
- package/resources/typings/VreoUnit.ts +11 -4
- package/stylesheets/custom/SpatialScenePanel.css +14 -8
- package/stylesheets/default.css +66 -0
package/docs/modules/react.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>react | Vreo</title><meta name="description" content="Documentation for Vreo"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><link rel="stylesheet" href="../assets/custom.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Vreo</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">Vreo</a></li><li><a href="react.html">react</a></li></ul><h1>Module react</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Interfaces</h3><ul class="tsd-index-list"><li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/react.VreoActionCallbacks.html" class="tsd-kind-icon">Vreo<wbr/>Action<wbr/>Callbacks</a></li><li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/react.VreoProviderProps.html" class="tsd-kind-icon">Vreo<wbr/>Provider<wbr/>Props</a></li></ul></section><section class="tsd-index-section "><h3>Variables</h3><ul class="tsd-index-list"><li class="tsd-kind-variable tsd-parent-kind-module"><a href="react.html#VreoProvider" class="tsd-kind-icon">Vreo<wbr/>Provider</a></li></ul></section><section class="tsd-index-section "><h3>Functions</h3><ul class="tsd-index-list"><li class="tsd-kind-function tsd-parent-kind-module"><a href="react.html#useVreoAction" class="tsd-kind-icon">use<wbr/>Vreo<wbr/>Action</a></li><li class="tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a href="react.html#useVreoEventCallback" class="tsd-kind-icon">use<wbr/>Vreo<wbr/>Event<wbr/>Callback</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="react.html#useVreoPausedState" class="tsd-kind-icon">use<wbr/>Vreo<wbr/>Paused<wbr/>State</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Variables</h2><section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-module"><a id="VreoProvider" class="tsd-anchor"></a><h3>Vreo<wbr/>Provider</h3><div class="tsd-signature tsd-kind-icon">Vreo<wbr/>Provider<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">React.FC</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/react.VreoProviderProps.html" class="tsd-signature-type" data-tsd-kind="Interface">VreoProviderProps</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/realsee-developer/vreo/blob/7ea5d6c/resources/react/index.tsx#L13">resources/react/index.tsx:13</a></li></ul></aside></section></section><section class="tsd-panel-group tsd-member-group "><h2>Functions</h2><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module"><a id="useVreoAction" class="tsd-anchor"></a><h3>use<wbr/>Vreo<wbr/>Action</h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module"><li class="tsd-signature tsd-kind-icon">use<wbr/>Vreo<wbr/>Action<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>dispose<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">; </span>hide<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">; </span>load<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>vreoUnit<span class="tsd-signature-symbol">: </span><a href="../interfaces/Player.VreoUnit.html" class="tsd-signature-type" data-tsd-kind="Interface">VreoUnit</a>, currentTime<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">; </span>pause<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">; </span>play<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>show<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol"> }</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/realsee-developer/vreo/blob/7ea5d6c/resources/react/index.tsx#L72">resources/react/index.tsx:72</a></li></ul></aside><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">{ </span>dispose<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">; </span>hide<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">; </span>load<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>vreoUnit<span class="tsd-signature-symbol">: </span><a href="../interfaces/Player.VreoUnit.html" class="tsd-signature-type" data-tsd-kind="Interface">VreoUnit</a>, currentTime<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">; </span>pause<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">; </span>play<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>show<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol"> }</span></h4><ul class="tsd-parameters"><li class="tsd-parameter"><h5>dispose<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li><li class="tsd-parameter"><h5>hide<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li><li class="tsd-parameter"><h5>load<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>vreoUnit<span class="tsd-signature-symbol">: </span><a href="../interfaces/Player.VreoUnit.html" class="tsd-signature-type" data-tsd-kind="Interface">VreoUnit</a>, currentTime<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>vreoUnit<span class="tsd-signature-symbol">: </span><a href="../interfaces/Player.VreoUnit.html" class="tsd-signature-type" data-tsd-kind="Interface">VreoUnit</a>, currentTime<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>vreoUnit: <a href="../interfaces/Player.VreoUnit.html" class="tsd-signature-type" data-tsd-kind="Interface">VreoUnit</a></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> currentTime: <span class="tsd-signature-type">number</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span></h4></li></ul></li></ul></li><li class="tsd-parameter"><h5>pause<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li><li class="tsd-parameter"><h5>play<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">boolean</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></li></ul></li><li class="tsd-parameter"><h5>show<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a id="useVreoEventCallback" class="tsd-anchor"></a><h3>use<wbr/>Vreo<wbr/>Event<wbr/>Callback</h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><li class="tsd-signature tsd-kind-icon">use<wbr/>Vreo<wbr/>Event<wbr/>Callback<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span>, callback<span class="tsd-signature-symbol">: </span><a href="Player.html#VreoKeyframeEvent" class="tsd-signature-type" data-tsd-kind="Type alias">VreoKeyframeEvent</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span><span class="tsd-signature-symbol">]</span>, deps<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">DependencyList</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/realsee-developer/vreo/blob/7ea5d6c/resources/react/index.tsx#L89">resources/react/index.tsx:89</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>T<span class="tsd-signature-symbol">: </span><a href="../enums/Player.VreoKeyframeEnum.html" class="tsd-signature-type" data-tsd-kind="Enumeration">VreoKeyframeEnum</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"loaded"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"paused"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"playing"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"unknownKeyframeType"</span></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span></h5></li><li><h5>callback: <a href="Player.html#VreoKeyframeEvent" class="tsd-signature-type" data-tsd-kind="Type alias">VreoKeyframeEvent</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span><span class="tsd-signature-symbol">]</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> deps: <span class="tsd-signature-type">DependencyList</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module"><a id="useVreoPausedState" class="tsd-anchor"></a><h3>use<wbr/>Vreo<wbr/>Paused<wbr/>State</h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module"><li class="tsd-signature tsd-kind-icon">use<wbr/>Vreo<wbr/>Paused<wbr/>State<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/realsee-developer/vreo/blob/7ea5d6c/resources/react/index.tsx#L109">resources/react/index.tsx:109</a></li></ul></aside><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../modules.html">Modules</a></li><li class=" tsd-kind-module"><a href="Player.html">Player</a></li><li class=" tsd-kind-module"><a href="custom.html">custom</a></li><li class=" tsd-kind-module"><a href="fivePlugins.html">five<wbr/>Plugins</a></li><li class="current tsd-kind-module"><a href="react.html">react</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/react.VreoActionCallbacks.html" class="tsd-kind-icon">Vreo<wbr/>Action<wbr/>Callbacks</a></li><li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/react.VreoProviderProps.html" class="tsd-kind-icon">Vreo<wbr/>Provider<wbr/>Props</a></li><li class="tsd-kind-variable tsd-parent-kind-module"><a href="react.html#VreoProvider" class="tsd-kind-icon">Vreo<wbr/>Provider</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="react.html#useVreoAction" class="tsd-kind-icon">use<wbr/>Vreo<wbr/>Action</a></li><li class="tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a href="react.html#useVreoEventCallback" class="tsd-kind-icon">use<wbr/>Vreo<wbr/>Event<wbr/>Callback</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="react.html#useVreoPausedState" class="tsd-kind-icon">use<wbr/>Vreo<wbr/>Paused<wbr/>State</a></li></ul></nav></div></div></div><footer class=""><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li><li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li><li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li><li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
|
1
|
+
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>react | Vreo</title><meta name="description" content="Documentation for Vreo"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><link rel="stylesheet" href="../assets/custom.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Vreo</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">Vreo</a></li><li><a href="react.html">react</a></li></ul><h1>Module react</h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Interfaces</h3><ul class="tsd-index-list"><li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/react.VreoActionCallbacks.html" class="tsd-kind-icon">Vreo<wbr/>Action<wbr/>Callbacks</a></li><li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/react.VreoProviderProps.html" class="tsd-kind-icon">Vreo<wbr/>Provider<wbr/>Props</a></li></ul></section><section class="tsd-index-section "><h3>Variables</h3><ul class="tsd-index-list"><li class="tsd-kind-variable tsd-parent-kind-module"><a href="react.html#VreoProvider" class="tsd-kind-icon">Vreo<wbr/>Provider</a></li></ul></section><section class="tsd-index-section "><h3>Functions</h3><ul class="tsd-index-list"><li class="tsd-kind-function tsd-parent-kind-module"><a href="react.html#useVreoAction" class="tsd-kind-icon">use<wbr/>Vreo<wbr/>Action</a></li><li class="tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a href="react.html#useVreoEventCallback" class="tsd-kind-icon">use<wbr/>Vreo<wbr/>Event<wbr/>Callback</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="react.html#useVreoPausedState" class="tsd-kind-icon">use<wbr/>Vreo<wbr/>Paused<wbr/>State</a></li></ul></section></div></section></section><section class="tsd-panel-group tsd-member-group "><h2>Variables</h2><section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-module"><a id="VreoProvider" class="tsd-anchor"></a><h3>Vreo<wbr/>Provider</h3><div class="tsd-signature tsd-kind-icon">Vreo<wbr/>Provider<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">React.FC</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/react.VreoProviderProps.html" class="tsd-signature-type" data-tsd-kind="Interface">VreoProviderProps</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/realsee-developer/vreo/blob/18077fe/resources/react/index.tsx#L13">resources/react/index.tsx:13</a></li></ul></aside></section></section><section class="tsd-panel-group tsd-member-group "><h2>Functions</h2><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module"><a id="useVreoAction" class="tsd-anchor"></a><h3>use<wbr/>Vreo<wbr/>Action</h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module"><li class="tsd-signature tsd-kind-icon">use<wbr/>Vreo<wbr/>Action<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span>dispose<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">; </span>hide<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">; </span>load<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>vreoUnit<span class="tsd-signature-symbol">: </span><a href="../interfaces/Player.VreoUnit.html" class="tsd-signature-type" data-tsd-kind="Interface">VreoUnit</a>, currentTime<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">; </span>pause<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">; </span>play<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>show<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol"> }</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/realsee-developer/vreo/blob/18077fe/resources/react/index.tsx#L72">resources/react/index.tsx:72</a></li></ul></aside><h4 class="tsd-returns-title">Returns <span class="tsd-signature-symbol">{ </span>dispose<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">; </span>hide<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">; </span>load<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>vreoUnit<span class="tsd-signature-symbol">: </span><a href="../interfaces/Player.VreoUnit.html" class="tsd-signature-type" data-tsd-kind="Interface">VreoUnit</a>, currentTime<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">; </span>pause<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">; </span>play<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">; </span>show<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol"> }</span></h4><ul class="tsd-parameters"><li class="tsd-parameter"><h5>dispose<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li><li class="tsd-parameter"><h5>hide<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li><li class="tsd-parameter"><h5>load<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>vreoUnit<span class="tsd-signature-symbol">: </span><a href="../interfaces/Player.VreoUnit.html" class="tsd-signature-type" data-tsd-kind="Interface">VreoUnit</a>, currentTime<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>vreoUnit<span class="tsd-signature-symbol">: </span><a href="../interfaces/Player.VreoUnit.html" class="tsd-signature-type" data-tsd-kind="Interface">VreoUnit</a>, currentTime<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>vreoUnit: <a href="../interfaces/Player.VreoUnit.html" class="tsd-signature-type" data-tsd-kind="Interface">VreoUnit</a></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> currentTime: <span class="tsd-signature-type">number</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">></span></h4></li></ul></li></ul></li><li class="tsd-parameter"><h5>pause<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li><li class="tsd-parameter"><h5>play<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">boolean</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></li></ul></li><li class="tsd-parameter"><h5>show<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span></h5><ul class="tsd-parameters"><li class="tsd-parameter-signature"><ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-type-literal"><li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a id="useVreoEventCallback" class="tsd-anchor"></a><h3>use<wbr/>Vreo<wbr/>Event<wbr/>Callback</h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><li class="tsd-signature tsd-kind-icon">use<wbr/>Vreo<wbr/>Event<wbr/>Callback<span class="tsd-signature-symbol"><</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">(</span>name<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span>, callback<span class="tsd-signature-symbol">: </span><a href="Player.html#VreoKeyframeEvent" class="tsd-signature-type" data-tsd-kind="Type alias">VreoKeyframeEvent</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span><span class="tsd-signature-symbol">]</span>, deps<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">DependencyList</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/realsee-developer/vreo/blob/18077fe/resources/react/index.tsx#L89">resources/react/index.tsx:89</a></li></ul></aside><h4 class="tsd-type-parameters-title">Type parameters</h4><ul class="tsd-type-parameters"><li><h4>T<span class="tsd-signature-symbol">: </span><a href="../enums/Player.VreoKeyframeEnum.html" class="tsd-signature-type" data-tsd-kind="Enumeration">VreoKeyframeEnum</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"loaded"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"paused"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"playing"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"unknownKeyframeType"</span></h4></li></ul><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameters"><li><h5>name: <span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span></h5></li><li><h5>callback: <a href="Player.html#VreoKeyframeEvent" class="tsd-signature-type" data-tsd-kind="Type alias">VreoKeyframeEvent</a><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type" data-tsd-kind="Type parameter">T</span><span class="tsd-signature-symbol">]</span></h5></li><li><h5><span class="tsd-flag ts-flagOptional">Optional</span> deps: <span class="tsd-signature-type">DependencyList</span></h5></li></ul><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></section><section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module"><a id="useVreoPausedState" class="tsd-anchor"></a><h3>use<wbr/>Vreo<wbr/>Paused<wbr/>State</h3><ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module"><li class="tsd-signature tsd-kind-icon">use<wbr/>Vreo<wbr/>Paused<wbr/>State<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li></ul><ul class="tsd-descriptions"><li class="tsd-description"><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/realsee-developer/vreo/blob/18077fe/resources/react/index.tsx#L109">resources/react/index.tsx:109</a></li></ul></aside><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4></li></ul></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../modules.html">Modules</a></li><li class=" tsd-kind-module"><a href="Player.html">Player</a></li><li class=" tsd-kind-module"><a href="custom.html">custom</a></li><li class=" tsd-kind-module"><a href="fivePlugins.html">five<wbr/>Plugins</a></li><li class="current tsd-kind-module"><a href="react.html">react</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/react.VreoActionCallbacks.html" class="tsd-kind-icon">Vreo<wbr/>Action<wbr/>Callbacks</a></li><li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/react.VreoProviderProps.html" class="tsd-kind-icon">Vreo<wbr/>Provider<wbr/>Props</a></li><li class="tsd-kind-variable tsd-parent-kind-module"><a href="react.html#VreoProvider" class="tsd-kind-icon">Vreo<wbr/>Provider</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="react.html#useVreoAction" class="tsd-kind-icon">use<wbr/>Vreo<wbr/>Action</a></li><li class="tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter"><a href="react.html#useVreoEventCallback" class="tsd-kind-icon">use<wbr/>Vreo<wbr/>Event<wbr/>Callback</a></li><li class="tsd-kind-function tsd-parent-kind-module"><a href="react.html#useVreoPausedState" class="tsd-kind-icon">use<wbr/>Vreo<wbr/>Paused<wbr/>State</a></li></ul></nav></div></div></div><footer class=""><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li><li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li><li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li><li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createHTMLAudioElement(): HTMLAudioElement;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createHTMLAudioElement = createHTMLAudioElement;
|
|
7
|
+
|
|
8
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
|
+
|
|
10
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
11
|
+
|
|
12
|
+
var BLANK_AUDIO = '' + 'data:audio/mpeg;base64,' + '//uQxAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAADAAAGhgBVVVVVVVVVVVVVVVVVVVVVVVV' + 'VVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////' + '////////////////////////////////8AAAA5TEFNRTMuOThyAc0AAAAAAAAAABSAJAiqQgAAg' + 'AAABobxtI73AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//uQxAACFEII9ACZ/sJZwWEoEb8w/////N//////Jcxj' + 'Hjf+7/v/H2PzCCFAiDtGeyBCIx7bJJ1mmEEMy6g8mm2c8nrGABB4h2Mkmn//4z/73u773R5qHHu' + '/j/w7Kxkzh5lWRWdsifCkNAnY9Zc1HvDAhjhSHdFkHFzLmabt/AQxSg2wwzLhHIJOBnAWwVY4zr' + 'hIYhhc2kvhYDfQ4hDi2Gmh5KyFn8EcGIrHAngNgIwVIEMf5bzbAiTRoAD///8z/KVhkkWEle6IX' + '+d/z4fvH3BShK1e5kmjkCMoxVmXhd4ROlTKo3iipasvTilY21q19ta30/v/0/idPX1v8PNxJL6r' + 'amnOVsdvMv2akO0iSYIzdJFirtzWXCZicS9vHqvSKyqm5XJBdqBwPxyfJdykhWTZ0G0ZyTZGpLK' + 'xsNwwoRhsx3tZfhwmeOBVISm3impAC/IT/8hP/EKEM1KMdVdVKM2rHV4x7HVXZvbVVKN/qq8CiV' + '9VL9jjH/6l6qf7MBCjZmOqsAibjcP+qqqv0oxqpa/NVW286hPo1nz2L/h8+jXt//uSxCmDU2IK/' + 'ECN98KKtE5IYzNoCfbw+u9i5r8PoadUMFPKqWL4LK3T/LCraMSHGkW4bpLXR/E6LlHOVQxmslKV' + 'J8IULktMN06N0FKCpHCoYsjC4F+Z0NVqdNFoGSTjSiyjzLdnZ2fNqTi2eHKONONKLMPMKLONKLM' + 'PQRJGlFxZRoKcJFAYEeIFiRQkUWUeYfef//Ko04soswso40UJAgMw8wosososy0EalnZyjQUGBR' + 'QGIFggOWUacWUeYmuadrZziQKKEgQsQLAhQkUJAgMQDghltLO1onp0cpkNInSFMqlYeSEJ5AHsq' + 'FdOwy1DA2sRmRJKxdKRfLhfLw5BzUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV' + 'VVVVVVVVVVVVVVVVVUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV' + 'VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV' + 'VVVVVVVVVVVVVVVVVVVf/7ksRRA8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVV' + 'VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV' + 'VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV' + 'VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV' + 'VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV' + 'VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV' + 'VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV' + 'VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=';
|
|
13
|
+
|
|
14
|
+
function createHTMLAudioElement() {
|
|
15
|
+
var ndAudio = document.querySelector('#vreo-playController-audio');
|
|
16
|
+
|
|
17
|
+
if (ndAudio) {
|
|
18
|
+
return ndAudio;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
var audio = document.createElement('audio');
|
|
22
|
+
audio.style.display = 'none';
|
|
23
|
+
audio.setAttribute('id', 'vreo-playController-audio');
|
|
24
|
+
audio.controls = false;
|
|
25
|
+
document.body.appendChild(audio);
|
|
26
|
+
audio.src = BLANK_AUDIO; // 触发一次播放
|
|
27
|
+
|
|
28
|
+
Promise.resolve( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
29
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
30
|
+
while (1) {
|
|
31
|
+
switch (_context.prev = _context.next) {
|
|
32
|
+
case 0:
|
|
33
|
+
_context.next = 2;
|
|
34
|
+
return audio.play();
|
|
35
|
+
|
|
36
|
+
case 2:
|
|
37
|
+
return _context.abrupt("return", _context.sent);
|
|
38
|
+
|
|
39
|
+
case 3:
|
|
40
|
+
case "end":
|
|
41
|
+
return _context.stop();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}, _callee);
|
|
45
|
+
})));
|
|
46
|
+
return audio;
|
|
47
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Subscribe } from '@realsee/five';
|
|
2
|
+
import { VreoKeyframe, VreoKeyframeEvent, VreoUnit } from '../typings/VreoUnit';
|
|
3
|
+
export interface PlayControllerConfig {
|
|
4
|
+
audio?: HTMLAudioElement;
|
|
5
|
+
}
|
|
6
|
+
export declare class PlayController extends Subscribe<VreoKeyframeEvent> {
|
|
7
|
+
vreoUnit?: VreoUnit;
|
|
8
|
+
config: PlayControllerConfig;
|
|
9
|
+
stopInterval: () => void;
|
|
10
|
+
get paused(): boolean;
|
|
11
|
+
get audioInstance(): HTMLAudioElement;
|
|
12
|
+
get currentTime(): number;
|
|
13
|
+
get currentKeyframes(): VreoKeyframe[];
|
|
14
|
+
/**
|
|
15
|
+
* 音频时长 不一定能获取得到,建议以 VreoUnit 配置的时长为准。
|
|
16
|
+
*/
|
|
17
|
+
get duration(): number;
|
|
18
|
+
constructor(config?: PlayControllerConfig);
|
|
19
|
+
/**
|
|
20
|
+
* 载入数据
|
|
21
|
+
*/
|
|
22
|
+
load(vreoUnit: VreoUnit): Promise<boolean>;
|
|
23
|
+
/**
|
|
24
|
+
* 播放
|
|
25
|
+
*/
|
|
26
|
+
play(): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* 暂停
|
|
29
|
+
*/
|
|
30
|
+
pause(): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* 销毁资源
|
|
33
|
+
* @notice 一旦销毁,创建的实例将不可用:需重新创建实例。
|
|
34
|
+
*
|
|
35
|
+
* @deprecated **慎重执行**
|
|
36
|
+
*/
|
|
37
|
+
dispose(): void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.PlayController = void 0;
|
|
9
|
+
|
|
10
|
+
var _five = require("@realsee/five");
|
|
11
|
+
|
|
12
|
+
var _animationFrame = require("../shared-utils/animationFrame");
|
|
13
|
+
|
|
14
|
+
var _createHTMLAudioElement = require("./createHTMLAudioElement");
|
|
15
|
+
|
|
16
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
17
|
+
|
|
18
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
19
|
+
|
|
20
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21
|
+
|
|
22
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
23
|
+
|
|
24
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
25
|
+
|
|
26
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
|
+
|
|
28
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
+
|
|
30
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
31
|
+
|
|
32
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
33
|
+
|
|
34
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
35
|
+
|
|
36
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
37
|
+
|
|
38
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
|
+
|
|
40
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
41
|
+
|
|
42
|
+
var closures = {};
|
|
43
|
+
|
|
44
|
+
var PlayController = /*#__PURE__*/function (_Subscribe) {
|
|
45
|
+
_inherits(PlayController, _Subscribe);
|
|
46
|
+
|
|
47
|
+
var _super = _createSuper(PlayController);
|
|
48
|
+
|
|
49
|
+
function PlayController() {
|
|
50
|
+
var _this;
|
|
51
|
+
|
|
52
|
+
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
53
|
+
|
|
54
|
+
_classCallCheck(this, PlayController);
|
|
55
|
+
|
|
56
|
+
_this = _super.call(this);
|
|
57
|
+
|
|
58
|
+
_defineProperty(_assertThisInitialized(_this), "config", {});
|
|
59
|
+
|
|
60
|
+
if (!config.audio) {
|
|
61
|
+
config.audio = (0, _createHTMLAudioElement.createHTMLAudioElement)();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
_this.config = Object.assign(_this.config, config);
|
|
65
|
+
|
|
66
|
+
closures.onPlaying = function () {
|
|
67
|
+
return _this.emit('playing');
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
closures.onPaused = function () {
|
|
71
|
+
return _this.emit('paused');
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
closures.onEnded = function () {
|
|
75
|
+
return _this.emit('paused', true);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
_this.audioInstance.addEventListener('play', closures.onPlaying);
|
|
79
|
+
|
|
80
|
+
_this.audioInstance.addEventListener('pause', closures.onPaused);
|
|
81
|
+
|
|
82
|
+
_this.audioInstance.addEventListener('ended', closures.onEnded);
|
|
83
|
+
|
|
84
|
+
_this.stopInterval = (0, _animationFrame.requestAnimationFrameInterval)(function () {
|
|
85
|
+
if (_this.audioInstance.paused) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (!_this.vreoUnit) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
var keyframes = _this.vreoUnit.keyframes;
|
|
94
|
+
var currentTime = _this.currentTime; // 没有被解析过且开始时间低于当前时间戳 100ms
|
|
95
|
+
|
|
96
|
+
var currentKeyframes = keyframes.filter(function (keyframe) {
|
|
97
|
+
if (keyframe.parsed) return false;
|
|
98
|
+
var dur = currentTime - keyframe.start;
|
|
99
|
+
return dur <= 60 && dur >= 0;
|
|
100
|
+
});
|
|
101
|
+
currentKeyframes.forEach(function (keyframe) {
|
|
102
|
+
if (keyframe.parsed) return;
|
|
103
|
+
keyframe.parsed = true;
|
|
104
|
+
|
|
105
|
+
_this.emit(keyframe.type, keyframe);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
return _this;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* 载入数据
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
_createClass(PlayController, [{
|
|
116
|
+
key: "paused",
|
|
117
|
+
get: function get() {
|
|
118
|
+
return this.audioInstance.paused;
|
|
119
|
+
}
|
|
120
|
+
}, {
|
|
121
|
+
key: "audioInstance",
|
|
122
|
+
get: function get() {
|
|
123
|
+
return this.config.audio;
|
|
124
|
+
}
|
|
125
|
+
}, {
|
|
126
|
+
key: "currentTime",
|
|
127
|
+
get: function get() {
|
|
128
|
+
return this.audioInstance.currentTime * 1000;
|
|
129
|
+
}
|
|
130
|
+
}, {
|
|
131
|
+
key: "currentKeyframes",
|
|
132
|
+
get: function get() {
|
|
133
|
+
var _this2 = this;
|
|
134
|
+
|
|
135
|
+
if (!this.vreoUnit) return [];
|
|
136
|
+
var keyframes = this.vreoUnit.keyframes; // 没有被解析过且开始时间低于当前时间戳 100ms
|
|
137
|
+
|
|
138
|
+
return keyframes.filter(function (keyframe) {
|
|
139
|
+
if (keyframe.parsed) return false;
|
|
140
|
+
var dur = _this2.currentTime - keyframe.start;
|
|
141
|
+
return dur <= 100 && dur >= 0;
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* 音频时长 不一定能获取得到,建议以 VreoUnit 配置的时长为准。
|
|
146
|
+
*/
|
|
147
|
+
|
|
148
|
+
}, {
|
|
149
|
+
key: "duration",
|
|
150
|
+
get: function get() {
|
|
151
|
+
return this.audioInstance.duration * 1000;
|
|
152
|
+
}
|
|
153
|
+
}, {
|
|
154
|
+
key: "load",
|
|
155
|
+
value: function () {
|
|
156
|
+
var _load = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(vreoUnit) {
|
|
157
|
+
var _this3 = this;
|
|
158
|
+
|
|
159
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
160
|
+
while (1) {
|
|
161
|
+
switch (_context.prev = _context.next) {
|
|
162
|
+
case 0:
|
|
163
|
+
this.vreoUnit = vreoUnit;
|
|
164
|
+
_context.next = 3;
|
|
165
|
+
return this.pause();
|
|
166
|
+
|
|
167
|
+
case 3:
|
|
168
|
+
_context.next = 5;
|
|
169
|
+
return new Promise(function (resolve, reject) {
|
|
170
|
+
if (vreoUnit.video.url === _this3.audioInstance.src) {
|
|
171
|
+
return resolve(true);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
_this3.audioInstance.src = vreoUnit.video.url;
|
|
175
|
+
|
|
176
|
+
var canplaythrough = function canplaythrough() {
|
|
177
|
+
resolve(true);
|
|
178
|
+
|
|
179
|
+
_this3.audioInstance.removeEventListener('canplaythrough', canplaythrough);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
var error = function error(err) {
|
|
183
|
+
reject(err);
|
|
184
|
+
|
|
185
|
+
_this3.audioInstance.removeEventListener('error', error);
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
_this3.audioInstance.addEventListener('canplaythrough', canplaythrough);
|
|
189
|
+
|
|
190
|
+
_this3.audioInstance.addEventListener('error', error);
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
case 5:
|
|
194
|
+
return _context.abrupt("return", _context.sent);
|
|
195
|
+
|
|
196
|
+
case 6:
|
|
197
|
+
case "end":
|
|
198
|
+
return _context.stop();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}, _callee, this);
|
|
202
|
+
}));
|
|
203
|
+
|
|
204
|
+
function load(_x) {
|
|
205
|
+
return _load.apply(this, arguments);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
return load;
|
|
209
|
+
}()
|
|
210
|
+
/**
|
|
211
|
+
* 播放
|
|
212
|
+
*/
|
|
213
|
+
|
|
214
|
+
}, {
|
|
215
|
+
key: "play",
|
|
216
|
+
value: function () {
|
|
217
|
+
var _play = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
218
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
219
|
+
while (1) {
|
|
220
|
+
switch (_context2.prev = _context2.next) {
|
|
221
|
+
case 0:
|
|
222
|
+
closures.playPromise = this.audioInstance.play();
|
|
223
|
+
|
|
224
|
+
case 1:
|
|
225
|
+
case "end":
|
|
226
|
+
return _context2.stop();
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}, _callee2, this);
|
|
230
|
+
}));
|
|
231
|
+
|
|
232
|
+
function play() {
|
|
233
|
+
return _play.apply(this, arguments);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return play;
|
|
237
|
+
}()
|
|
238
|
+
/**
|
|
239
|
+
* 暂停
|
|
240
|
+
*/
|
|
241
|
+
|
|
242
|
+
}, {
|
|
243
|
+
key: "pause",
|
|
244
|
+
value: function () {
|
|
245
|
+
var _pause = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
|
|
246
|
+
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
247
|
+
while (1) {
|
|
248
|
+
switch (_context3.prev = _context3.next) {
|
|
249
|
+
case 0:
|
|
250
|
+
if (!closures.playPromise) {
|
|
251
|
+
_context3.next = 3;
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
_context3.next = 3;
|
|
256
|
+
return closures.playPromise;
|
|
257
|
+
|
|
258
|
+
case 3:
|
|
259
|
+
this.audioInstance.pause();
|
|
260
|
+
|
|
261
|
+
case 4:
|
|
262
|
+
case "end":
|
|
263
|
+
return _context3.stop();
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}, _callee3, this);
|
|
267
|
+
}));
|
|
268
|
+
|
|
269
|
+
function pause() {
|
|
270
|
+
return _pause.apply(this, arguments);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
return pause;
|
|
274
|
+
}()
|
|
275
|
+
/**
|
|
276
|
+
* 销毁资源
|
|
277
|
+
* @notice 一旦销毁,创建的实例将不可用:需重新创建实例。
|
|
278
|
+
*
|
|
279
|
+
* @deprecated **慎重执行**
|
|
280
|
+
*/
|
|
281
|
+
|
|
282
|
+
}, {
|
|
283
|
+
key: "dispose",
|
|
284
|
+
value: function dispose() {
|
|
285
|
+
// 清理事件监听
|
|
286
|
+
this.audioInstance.removeEventListener('play', closures.onPlaying);
|
|
287
|
+
this.audioInstance.removeEventListener('pasue', closures.onPaused);
|
|
288
|
+
this.audioInstance.removeEventListener('ended', closures.onEnded);
|
|
289
|
+
|
|
290
|
+
if (this.stopInterval) {
|
|
291
|
+
this.stopInterval();
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}]);
|
|
295
|
+
|
|
296
|
+
return PlayController;
|
|
297
|
+
}(_five.Subscribe);
|
|
298
|
+
|
|
299
|
+
exports.PlayController = PlayController;
|
|
300
|
+
console.log("\n\n\u250F\u2501\u2501\u2501\u2513\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u250F\u2513\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n\u2503\u250F\u2501\u2513\u2503\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2503\u2503\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n\u2503\u2517\u2501\u251B\u2503\u250F\u2501\u2501\u2513\u250F\u2501\u2501\u2513\u2501\u2503\u2503\u2501\u250F\u2501\u2501\u2513\u250F\u2501\u2501\u2513\u250F\u2501\u2501\u2513\n\u2503\u250F\u2513\u250F\u251B\u2503\u250F\u2513\u2503\u2517\u2501\u2513\u2503\u2501\u2503\u2503\u2501\u2503\u2501\u2501\u252B\u2503\u250F\u2513\u2503\u2503\u250F\u2513\u2503\n\u2503\u2503\u2503\u2517\u2513\u2503\u2503\u2501\u252B\u2503\u2517\u251B\u2517\u2513\u2503\u2517\u2513\u2523\u2501\u2501\u2503\u2503\u2503\u2501\u252B\u2503\u2503\u2501\u252B\n\u2517\u251B\u2517\u2501\u251B\u2517\u2501\u2501\u251B\u2517\u2501\u2501\u2501\u251B\u2517\u2501\u251B\u2517\u2501\u2501\u251B\u2517\u2501\u2501\u251B\u2517\u2501\u2501\u251B\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 \n\n");
|
|
@@ -15,6 +15,8 @@ export declare class Controller extends Subscribe<VreoKeyframeEvent> {
|
|
|
15
15
|
playing: boolean;
|
|
16
16
|
visible: boolean;
|
|
17
17
|
get isAudio(): boolean;
|
|
18
|
+
popUp: string | JSX.Element | null;
|
|
19
|
+
openPopUp(popUp: string | JSX.Element | false): void;
|
|
18
20
|
drawerConfig: {
|
|
19
21
|
content: string | JSX.Element;
|
|
20
22
|
height?: number | string;
|
package/lib/Player/Controller.js
CHANGED
|
@@ -60,6 +60,8 @@ var Controller = /*#__PURE__*/function (_Subscribe) {
|
|
|
60
60
|
|
|
61
61
|
_defineProperty(_assertThisInitialized(_this), "visible", false);
|
|
62
62
|
|
|
63
|
+
_defineProperty(_assertThisInitialized(_this), "popUp", null);
|
|
64
|
+
|
|
63
65
|
_defineProperty(_assertThisInitialized(_this), "drawerConfig", null);
|
|
64
66
|
|
|
65
67
|
(0, _mobx.makeObservable)(_assertThisInitialized(_this), {
|
|
@@ -67,6 +69,8 @@ var Controller = /*#__PURE__*/function (_Subscribe) {
|
|
|
67
69
|
setVisible: _mobx.action,
|
|
68
70
|
playing: _mobx.observable,
|
|
69
71
|
setPlaying: _mobx.action,
|
|
72
|
+
popUp: _mobx.observable.ref,
|
|
73
|
+
openPopUp: _mobx.action,
|
|
70
74
|
drawerConfig: _mobx.observable.ref,
|
|
71
75
|
openDrawer: _mobx.action
|
|
72
76
|
}); // 监听播放情况:抛出触发时机
|
|
@@ -86,6 +90,16 @@ var Controller = /*#__PURE__*/function (_Subscribe) {
|
|
|
86
90
|
|
|
87
91
|
return !((_this$videoAgentScene = this.videoAgentScene) !== null && _this$videoAgentScene !== void 0 && (_this$videoAgentScene2 = _this$videoAgentScene.videoAgentMesh.videoUrl) !== null && _this$videoAgentScene2 !== void 0 && _this$videoAgentScene2.endsWith('.mp4'));
|
|
88
92
|
}
|
|
93
|
+
}, {
|
|
94
|
+
key: "openPopUp",
|
|
95
|
+
value: function openPopUp(popUp) {
|
|
96
|
+
if (!popUp) {
|
|
97
|
+
this.popUp = null;
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
this.popUp = popUp;
|
|
102
|
+
}
|
|
89
103
|
}, {
|
|
90
104
|
key: "setVisible",
|
|
91
105
|
value: function setVisible(v) {
|
|
@@ -8,12 +8,12 @@ export interface SpatialScenePanelData {
|
|
|
8
8
|
text: string;
|
|
9
9
|
icon: string;
|
|
10
10
|
}[];
|
|
11
|
-
position
|
|
11
|
+
position?: {
|
|
12
12
|
x: number;
|
|
13
13
|
y: number;
|
|
14
14
|
z: number;
|
|
15
15
|
};
|
|
16
|
-
quaternion
|
|
16
|
+
quaternion?: [number, number, number, number];
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* 空间场景面板
|