@draftbit/core 50.1.1-2e3307.2 → 50.1.1-eb22bb.2
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/lib/commonjs/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +1 -1
- package/lib/commonjs/components/MediaPlayer/MediaPlayerCommon.js +1 -1
- package/lib/commonjs/components/MediaPlayer/VideoPlayer/VideoPlayer.js +1 -1
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +3 -25
- package/lib/typescript/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/MediaPlayerCommon.d.ts +6 -0
- package/lib/typescript/src/components/MediaPlayer/MediaPlayerCommon.js +43 -0
- package/lib/typescript/src/components/MediaPlayer/MediaPlayerCommon.js.map +1 -1
- package/lib/typescript/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js +11 -3
- package/lib/typescript/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -4
- package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js +3 -25
- package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.js.map +1 -1
- package/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.tsx +8 -31
- package/src/components/MediaPlayer/MediaPlayerCommon.js +43 -0
- package/src/components/MediaPlayer/MediaPlayerCommon.js.map +1 -1
- package/src/components/MediaPlayer/MediaPlayerCommon.ts +56 -0
- package/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js +11 -3
- package/src/components/MediaPlayer/VideoPlayer/VideoPlayer.js.map +1 -1
- package/src/components/MediaPlayer/VideoPlayer/VideoPlayer.tsx +18 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.tsx";import*as React from"react";import{Audio,InterruptionModeIOS,InterruptionModeAndroid}from"expo-av";import{mapToMediaPlayerStatus}from"../MediaPlayerCommon";import MediaPlaybackWrapper from"../MediaPlaybackWrapper";import{jsx as _jsx}from"react/jsx-runtime";var HeadlessAudioPlayer=React.forwardRef(function(_ref,ref){var source=_ref.source,_ref$interruptionMode=_ref.interruptionMode,interruptionMode=_ref$interruptionMode===void 0?"lower volume":_ref$interruptionMode,_ref$playsInBackgroun=_ref.playsInBackground,playsInBackground=_ref$playsInBackgroun===void 0?false:_ref$playsInBackgroun,_ref$playsInSilentMod=_ref.playsInSilentModeIOS,playsInSilentModeIOS=_ref$playsInSilentMod===void 0?false:_ref$playsInSilentMod,_ref$playThroughEarpi=_ref.playThroughEarpieceAndroid,playThroughEarpieceAndroid=_ref$playThroughEarpi===void 0?false:_ref$playThroughEarpi,onPlaybackStatusUpdateProp=_ref.onPlaybackStatusUpdate,onPlaybackFinish=_ref.onPlaybackFinish;var _React$useState=React.useState(),_React$useState2=_slicedToArray(_React$useState,2),currentSound=_React$useState2[0],setCurrentSound=_React$useState2[1];var _React$useState3=React.useState(false),_React$useState4=_slicedToArray(_React$useState3,2),isPlaying=_React$useState4[0],setIsPlaying=_React$useState4[1];var updateAudioMode=React.useCallback(_asyncToGenerator(function*(){try{yield Audio.setAudioModeAsync({staysActiveInBackground:playsInBackground,interruptionModeIOS:interruptionMode==="lower volume"?InterruptionModeIOS.DuckOthers:InterruptionModeIOS.DoNotMix,interruptionModeAndroid:interruptionMode==="lower volume"?InterruptionModeAndroid.DuckOthers:InterruptionModeAndroid.DoNotMix,playsInSilentModeIOS:playsInSilentModeIOS,playThroughEarpieceAndroid:playThroughEarpieceAndroid});}catch(e){console.error("Failed to set audio mode. interruptionMode, playsInBackground, playsInSilentModeIOS, playThroughEarpieceAndroid might not be set. Failed with",e);}}),[interruptionMode,playsInBackground,playsInSilentModeIOS,playThroughEarpieceAndroid]);var onPlaybackStatusUpdate=function onPlaybackStatusUpdate(status){var mappedStatus=mapToMediaPlayerStatus(status);onPlaybackStatusUpdateProp==null?void 0:onPlaybackStatusUpdateProp(mappedStatus);if(status.isLoaded){if(status.didJustFinish){onPlaybackFinish==null?void 0:onPlaybackFinish();}setIsPlaying(status.isPlaying);}};var onTogglePlayback=function onTogglePlayback(){updateAudioMode();};var loadAudio=function(){var _ref3=_asyncToGenerator(function*(){onPlaybackStatusUpdateProp==null?void 0:onPlaybackStatusUpdateProp({isPlaying:false,isLoading:true,isBuffering:false,currentPositionMillis:0,durationMillis:0,bufferedDurationMillis:0,isError:false});var _yield$Audio$Sound$cr=yield Audio.Sound.createAsync(
|
|
1
|
+
import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.tsx";import*as React from"react";import{Audio,InterruptionModeIOS,InterruptionModeAndroid}from"expo-av";import{mapToMediaPlayerStatus,normalizeBase64Source,useSourceDeepCompareEffect}from"../MediaPlayerCommon";import MediaPlaybackWrapper from"../MediaPlaybackWrapper";import{jsx as _jsx}from"react/jsx-runtime";var HeadlessAudioPlayer=React.forwardRef(function(_ref,ref){var source=_ref.source,_ref$interruptionMode=_ref.interruptionMode,interruptionMode=_ref$interruptionMode===void 0?"lower volume":_ref$interruptionMode,_ref$playsInBackgroun=_ref.playsInBackground,playsInBackground=_ref$playsInBackgroun===void 0?false:_ref$playsInBackgroun,_ref$playsInSilentMod=_ref.playsInSilentModeIOS,playsInSilentModeIOS=_ref$playsInSilentMod===void 0?false:_ref$playsInSilentMod,_ref$playThroughEarpi=_ref.playThroughEarpieceAndroid,playThroughEarpieceAndroid=_ref$playThroughEarpi===void 0?false:_ref$playThroughEarpi,onPlaybackStatusUpdateProp=_ref.onPlaybackStatusUpdate,onPlaybackFinish=_ref.onPlaybackFinish;var _React$useState=React.useState(),_React$useState2=_slicedToArray(_React$useState,2),currentSound=_React$useState2[0],setCurrentSound=_React$useState2[1];var _React$useState3=React.useState(false),_React$useState4=_slicedToArray(_React$useState3,2),isPlaying=_React$useState4[0],setIsPlaying=_React$useState4[1];var updateAudioMode=React.useCallback(_asyncToGenerator(function*(){try{yield Audio.setAudioModeAsync({staysActiveInBackground:playsInBackground,interruptionModeIOS:interruptionMode==="lower volume"?InterruptionModeIOS.DuckOthers:InterruptionModeIOS.DoNotMix,interruptionModeAndroid:interruptionMode==="lower volume"?InterruptionModeAndroid.DuckOthers:InterruptionModeAndroid.DoNotMix,playsInSilentModeIOS:playsInSilentModeIOS,playThroughEarpieceAndroid:playThroughEarpieceAndroid});}catch(e){console.error("Failed to set audio mode. interruptionMode, playsInBackground, playsInSilentModeIOS, playThroughEarpieceAndroid might not be set. Failed with",e);}}),[interruptionMode,playsInBackground,playsInSilentModeIOS,playThroughEarpieceAndroid]);var onPlaybackStatusUpdate=function onPlaybackStatusUpdate(status){var mappedStatus=mapToMediaPlayerStatus(status);onPlaybackStatusUpdateProp==null?void 0:onPlaybackStatusUpdateProp(mappedStatus);if(status.isLoaded){if(status.didJustFinish){onPlaybackFinish==null?void 0:onPlaybackFinish();}setIsPlaying(status.isPlaying);}};var onTogglePlayback=function onTogglePlayback(){updateAudioMode();};var loadAudio=function(){var _ref3=_asyncToGenerator(function*(){onPlaybackStatusUpdateProp==null?void 0:onPlaybackStatusUpdateProp({isPlaying:false,isLoading:true,isBuffering:false,currentPositionMillis:0,durationMillis:0,bufferedDurationMillis:0,isError:false});var finalSource=yield normalizeBase64Source(source);var _yield$Audio$Sound$cr=yield Audio.Sound.createAsync(finalSource),sound=_yield$Audio$Sound$cr.sound;setCurrentSound(sound);sound.setOnPlaybackStatusUpdate(onPlaybackStatusUpdate);});return function loadAudio(){return _ref3.apply(this,arguments);};}();useSourceDeepCompareEffect(function(){loadAudio();},[source]);return _jsx(MediaPlaybackWrapper,{ref:ref,isPlaying:isPlaying,media:currentSound,onTogglePlayback:onTogglePlayback});});export default HeadlessAudioPlayer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function mapToMediaPlayerStatus(status){if(status.isLoaded){return{isPlaying:status.isPlaying,isLoading:false,isBuffering:status.isBuffering,currentPositionMillis:status.positionMillis||0,durationMillis:status.durationMillis||0,bufferedDurationMillis:status.playableDurationMillis||0,isError:false};}return{isPlaying:false,isLoading:false,isBuffering:false,currentPositionMillis:0,durationMillis:0,bufferedDurationMillis:0,isError:true,error:status.error};}
|
|
1
|
+
import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import*as FileSystem from"expo-file-system";import{v4 as uuid}from"uuid";import{Platform}from"react-native";import React from"react";export function mapToMediaPlayerStatus(status){if(status.isLoaded){return{isPlaying:status.isPlaying,isLoading:false,isBuffering:status.isBuffering,currentPositionMillis:status.positionMillis||0,durationMillis:status.durationMillis||0,bufferedDurationMillis:status.playableDurationMillis||0,isError:false};}return{isPlaying:false,isLoading:false,isBuffering:false,currentPositionMillis:0,durationMillis:0,bufferedDurationMillis:0,isError:true,error:status.error};}var BASE_64_REGEX=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;export function normalizeBase64Source(_x){return _normalizeBase64Source.apply(this,arguments);}function _normalizeBase64Source(){_normalizeBase64Source=_asyncToGenerator(function*(source){var uri=source==null?void 0:source.uri;if(Platform.OS==="ios"&&uri&&uri.match(BASE_64_REGEX)){var fileName=`${FileSystem.cacheDirectory}${uuid()}`;yield FileSystem.writeAsStringAsync(fileName,uri,{encoding:FileSystem.EncodingType.Base64});return{uri:fileName};}return source;});return _normalizeBase64Source.apply(this,arguments);}function sourceDeepCompareEquals(a,b){if(a!=null&&a.uri&&b!=null&&b.uri){return a.uri===b.uri;}return a===b;}function useSourceDeepCompareMemoize(value){var ref=React.useRef();if(!sourceDeepCompareEquals(value,ref.current)){ref.current=value;}return ref.current;}export function useSourceDeepCompareEffect(callback,dependencies){React.useEffect(callback,dependencies.map(useSourceDeepCompareMemoize));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style","resizeMode","posterResizeMode","onPlaybackStatusUpdate","onPlaybackFinish"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/MediaPlayer/VideoPlayer/VideoPlayer.tsx";import React from"react";import{Video as VideoPlayerComponent,ResizeMode as ExpoResizeMode,VideoFullscreenUpdate}from"expo-av";import{extractSizeStyles}from"../../../utilities";import MediaPlaybackWrapper from"../MediaPlaybackWrapper";import{mapToMediaPlayerStatus}from"../MediaPlayerCommon";import{jsx as _jsx}from"react/jsx-runtime";var VideoPlayer=React.forwardRef(function(_ref,ref){var style=_ref.style,_ref$resizeMode=_ref.resizeMode,resizeMode=_ref$resizeMode===void 0?"contain":_ref$resizeMode,_ref$posterResizeMode=_ref.posterResizeMode,posterResizeMode=_ref$posterResizeMode===void 0?"cover":_ref$posterResizeMode,onPlaybackStatusUpdateProp=_ref.onPlaybackStatusUpdate,onPlaybackFinish=_ref.onPlaybackFinish,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(),_React$useState2=_slicedToArray(_React$useState,2),videoMediaObject=_React$useState2[0],setVideoMediaObject=_React$useState2[1];var _React$useState3=React.useState(false),_React$useState4=_slicedToArray(_React$useState3,2),isPlaying=_React$useState4[0],setIsPlaying=_React$useState4[1];var _React$useState5=React.useState(false),_React$useState6=_slicedToArray(_React$useState5,2),isFullscreen=_React$useState6[0],setIsFullscreen=_React$useState6[1];var mediaPlaybackWrapperRef=React.useRef(null);var sizeStyles=extractSizeStyles(style);var mappedResizeMode;switch(resizeMode){case"contain":mappedResizeMode=ExpoResizeMode.CONTAIN;break;case"cover":mappedResizeMode=ExpoResizeMode.COVER;break;case"stretch":mappedResizeMode=ExpoResizeMode.STRETCH;break;}var onPlaybackStatusUpdate=function onPlaybackStatusUpdate(status){var mappedStatus=mapToMediaPlayerStatus(status);onPlaybackStatusUpdateProp==null?void 0:onPlaybackStatusUpdateProp(mappedStatus);if(status.isLoaded){if(status.didJustFinish){onPlaybackFinish==null?void 0:onPlaybackFinish();}setIsPlaying(status.isPlaying);}};var _onFullscreenUpdate=function onFullscreenUpdate(fullscreenUpdate){switch(fullscreenUpdate){case VideoFullscreenUpdate.PLAYER_DID_PRESENT:case VideoFullscreenUpdate.PLAYER_WILL_PRESENT:setIsFullscreen(true);break;case VideoFullscreenUpdate.PLAYER_DID_DISMISS:case VideoFullscreenUpdate.PLAYER_WILL_DISMISS:setIsFullscreen(false);break;}};var toggleFullscreen=React.useCallback(_asyncToGenerator(function*(){if(isFullscreen){yield videoMediaObject==null?void 0:videoMediaObject.dismissFullscreenPlayer();}else{yield videoMediaObject==null?void 0:videoMediaObject.presentFullscreenPlayer();}}),[isFullscreen,videoMediaObject]);React.useImperativeHandle(ref,function(){var _mediaPlaybackWrapper,_mediaPlaybackWrapper2,_mediaPlaybackWrapper3,_mediaPlaybackWrapper4;return{toggleFullscreen:toggleFullscreen,seekToPosition:((_mediaPlaybackWrapper=mediaPlaybackWrapperRef.current)==null?void 0:_mediaPlaybackWrapper.seekToPosition)||function(){},togglePlayback:((_mediaPlaybackWrapper2=mediaPlaybackWrapperRef.current)==null?void 0:_mediaPlaybackWrapper2.togglePlayback)||function(){},pause:((_mediaPlaybackWrapper3=mediaPlaybackWrapperRef.current)==null?void 0:_mediaPlaybackWrapper3.pause)||function(){},play:((_mediaPlaybackWrapper4=mediaPlaybackWrapperRef.current)==null?void 0:_mediaPlaybackWrapper4.play)||function(){}};},[toggleFullscreen,isPlaying]);return _jsx(MediaPlaybackWrapper,{media:videoMediaObject,isPlaying:isPlaying,ref:mediaPlaybackWrapperRef,children:_jsx(VideoPlayerComponent,Object.assign({ref:function ref(component){return setVideoMediaObject(component);},style:style,videoStyle:sizeStyles,resizeMode:mappedResizeMode,posterStyle:[sizeStyles,{resizeMode:posterResizeMode}],onPlaybackStatusUpdate:onPlaybackStatusUpdate,onFullscreenUpdate:function onFullscreenUpdate(e){return _onFullscreenUpdate(e.fullscreenUpdate);}},rest))});});export default VideoPlayer;
|
|
1
|
+
import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["style","resizeMode","posterResizeMode","onPlaybackStatusUpdate","onPlaybackFinish","source"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/MediaPlayer/VideoPlayer/VideoPlayer.tsx";import React from"react";import{Video as VideoPlayerComponent,ResizeMode as ExpoResizeMode,VideoFullscreenUpdate}from"expo-av";import{extractSizeStyles}from"../../../utilities";import MediaPlaybackWrapper from"../MediaPlaybackWrapper";import{mapToMediaPlayerStatus,normalizeBase64Source,useSourceDeepCompareEffect}from"../MediaPlayerCommon";import{jsx as _jsx}from"react/jsx-runtime";var VideoPlayer=React.forwardRef(function(_ref,ref){var style=_ref.style,_ref$resizeMode=_ref.resizeMode,resizeMode=_ref$resizeMode===void 0?"contain":_ref$resizeMode,_ref$posterResizeMode=_ref.posterResizeMode,posterResizeMode=_ref$posterResizeMode===void 0?"cover":_ref$posterResizeMode,onPlaybackStatusUpdateProp=_ref.onPlaybackStatusUpdate,onPlaybackFinish=_ref.onPlaybackFinish,source=_ref.source,rest=_objectWithoutProperties(_ref,_excluded);var _React$useState=React.useState(),_React$useState2=_slicedToArray(_React$useState,2),videoMediaObject=_React$useState2[0],setVideoMediaObject=_React$useState2[1];var _React$useState3=React.useState(false),_React$useState4=_slicedToArray(_React$useState3,2),isPlaying=_React$useState4[0],setIsPlaying=_React$useState4[1];var _React$useState5=React.useState(false),_React$useState6=_slicedToArray(_React$useState5,2),isFullscreen=_React$useState6[0],setIsFullscreen=_React$useState6[1];var _React$useState7=React.useState(),_React$useState8=_slicedToArray(_React$useState7,2),currentSource=_React$useState8[0],setCurrentSource=_React$useState8[1];var mediaPlaybackWrapperRef=React.useRef(null);var sizeStyles=extractSizeStyles(style);var mappedResizeMode;switch(resizeMode){case"contain":mappedResizeMode=ExpoResizeMode.CONTAIN;break;case"cover":mappedResizeMode=ExpoResizeMode.COVER;break;case"stretch":mappedResizeMode=ExpoResizeMode.STRETCH;break;}var onPlaybackStatusUpdate=function onPlaybackStatusUpdate(status){var mappedStatus=mapToMediaPlayerStatus(status);onPlaybackStatusUpdateProp==null?void 0:onPlaybackStatusUpdateProp(mappedStatus);if(status.isLoaded){if(status.didJustFinish){onPlaybackFinish==null?void 0:onPlaybackFinish();}setIsPlaying(status.isPlaying);}};var _onFullscreenUpdate=function onFullscreenUpdate(fullscreenUpdate){switch(fullscreenUpdate){case VideoFullscreenUpdate.PLAYER_DID_PRESENT:case VideoFullscreenUpdate.PLAYER_WILL_PRESENT:setIsFullscreen(true);break;case VideoFullscreenUpdate.PLAYER_DID_DISMISS:case VideoFullscreenUpdate.PLAYER_WILL_DISMISS:setIsFullscreen(false);break;}};var toggleFullscreen=React.useCallback(_asyncToGenerator(function*(){if(isFullscreen){yield videoMediaObject==null?void 0:videoMediaObject.dismissFullscreenPlayer();}else{yield videoMediaObject==null?void 0:videoMediaObject.presentFullscreenPlayer();}}),[isFullscreen,videoMediaObject]);React.useImperativeHandle(ref,function(){var _mediaPlaybackWrapper,_mediaPlaybackWrapper2,_mediaPlaybackWrapper3,_mediaPlaybackWrapper4;return{toggleFullscreen:toggleFullscreen,seekToPosition:((_mediaPlaybackWrapper=mediaPlaybackWrapperRef.current)==null?void 0:_mediaPlaybackWrapper.seekToPosition)||function(){},togglePlayback:((_mediaPlaybackWrapper2=mediaPlaybackWrapperRef.current)==null?void 0:_mediaPlaybackWrapper2.togglePlayback)||function(){},pause:((_mediaPlaybackWrapper3=mediaPlaybackWrapperRef.current)==null?void 0:_mediaPlaybackWrapper3.pause)||function(){},play:((_mediaPlaybackWrapper4=mediaPlaybackWrapperRef.current)==null?void 0:_mediaPlaybackWrapper4.play)||function(){}};},[toggleFullscreen,isPlaying]);useSourceDeepCompareEffect(function(){var updateSource=function(){var _ref3=_asyncToGenerator(function*(){var finalSource=yield normalizeBase64Source(source);setCurrentSource(finalSource);});return function updateSource(){return _ref3.apply(this,arguments);};}();updateSource();},[source]);return _jsx(MediaPlaybackWrapper,{media:videoMediaObject,isPlaying:isPlaying,ref:mediaPlaybackWrapperRef,children:_jsx(VideoPlayerComponent,Object.assign({ref:function ref(component){return setVideoMediaObject(component);},style:style,videoStyle:sizeStyles,resizeMode:mappedResizeMode,posterStyle:[sizeStyles,{resizeMode:posterResizeMode}],onPlaybackStatusUpdate:onPlaybackStatusUpdate,onFullscreenUpdate:function onFullscreenUpdate(e){return _onFullscreenUpdate(e.fullscreenUpdate);},source:currentSource},rest))});});export default VideoPlayer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Audio, InterruptionModeIOS, InterruptionModeAndroid, } from "expo-av";
|
|
3
|
-
import { mapToMediaPlayerStatus } from "../MediaPlayerCommon";
|
|
3
|
+
import { mapToMediaPlayerStatus, normalizeBase64Source, useSourceDeepCompareEffect, } from "../MediaPlayerCommon";
|
|
4
4
|
import MediaPlaybackWrapper from "../MediaPlaybackWrapper";
|
|
5
5
|
/**
|
|
6
6
|
* Audio Player component without an interface (UI).
|
|
@@ -56,7 +56,8 @@ const HeadlessAudioPlayer = React.forwardRef(({ source, interruptionMode = "lowe
|
|
|
56
56
|
bufferedDurationMillis: 0,
|
|
57
57
|
isError: false,
|
|
58
58
|
});
|
|
59
|
-
|
|
59
|
+
let finalSource = await normalizeBase64Source(source);
|
|
60
|
+
const { sound } = await Audio.Sound.createAsync(finalSource);
|
|
60
61
|
setCurrentSound(sound);
|
|
61
62
|
sound.setOnPlaybackStatusUpdate(onPlaybackStatusUpdate);
|
|
62
63
|
};
|
|
@@ -66,28 +67,5 @@ const HeadlessAudioPlayer = React.forwardRef(({ source, interruptionMode = "lowe
|
|
|
66
67
|
}, [source]);
|
|
67
68
|
return (React.createElement(MediaPlaybackWrapper, { ref: ref, isPlaying: isPlaying, media: currentSound, onTogglePlayback: onTogglePlayback }));
|
|
68
69
|
});
|
|
69
|
-
// The source provided into the AudioPlayer can be of type {uri: "some uri"}
|
|
70
|
-
// In the case that this object is created inline, each rerender provides a new source object because a new object is initialized everytime
|
|
71
|
-
// This creates an issue with being a useEffect dependency
|
|
72
|
-
//
|
|
73
|
-
// This creates variants of useEffect that checks deep equality of 'uri' to determine if dependency changed or not
|
|
74
|
-
// Follows: https://stackoverflow.com/a/54096391
|
|
75
|
-
function sourceDeepCompareEquals(a, b) {
|
|
76
|
-
if ((a === null || a === void 0 ? void 0 : a.uri) && (b === null || b === void 0 ? void 0 : b.uri)) {
|
|
77
|
-
return a.uri === b.uri;
|
|
78
|
-
}
|
|
79
|
-
return a === b;
|
|
80
|
-
}
|
|
81
|
-
function useSourceDeepCompareMemoize(value) {
|
|
82
|
-
const ref = React.useRef();
|
|
83
|
-
if (!sourceDeepCompareEquals(value, ref.current)) {
|
|
84
|
-
ref.current = value;
|
|
85
|
-
}
|
|
86
|
-
return ref.current;
|
|
87
|
-
}
|
|
88
|
-
function useSourceDeepCompareEffect(callback, dependencies) {
|
|
89
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
90
|
-
React.useEffect(callback, dependencies.map(useSourceDeepCompareMemoize));
|
|
91
|
-
}
|
|
92
70
|
export default HeadlessAudioPlayer;
|
|
93
71
|
//# sourceMappingURL=HeadlessAudioPlayer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeadlessAudioPlayer.js","sourceRoot":"","sources":["../../../../../../src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,KAAK,EAEL,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,SAAS,CAAC;AAEjB,OAAO,
|
|
1
|
+
{"version":3,"file":"HeadlessAudioPlayer.js","sourceRoot":"","sources":["../../../../../../src/components/MediaPlayer/AudioPlayer/HeadlessAudioPlayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,KAAK,EAEL,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,oBAAoB,MAAM,yBAAyB,CAAC;AAE3D;;;GAGG;AACH,MAAM,mBAAmB,GAAG,KAAK,CAAC,UAAU,CAI1C,CACE,EACE,MAAM,EACN,gBAAgB,GAAG,cAAc,EACjC,iBAAiB,GAAG,KAAK,EACzB,oBAAoB,GAAG,KAAK,EAC5B,0BAA0B,GAAG,KAAK,EAClC,sBAAsB,EAAE,0BAA0B,EAClD,gBAAgB,GACjB,EACD,GAAG,EACH,EAAE;IACF,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAe,CAAC;IACtE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAExD,MAAM,eAAe,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE;QACnD,IAAI;YACF,MAAM,KAAK,CAAC,iBAAiB,CAAC;gBAC5B,uBAAuB,EAAE,iBAAiB;gBAC1C,mBAAmB,EACjB,gBAAgB,KAAK,cAAc;oBACjC,CAAC,CAAC,mBAAmB,CAAC,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,CAAC,CAAC;QAEtD,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAC7D,eAAe,CAAC,KAAK,CAAC,CAAC;QACvB,KAAK,CAAC,yBAAyB,CAAC,sBAAsB,CAAC,CAAC;IAC1D,CAAC,CAAC;IAEF,0BAA0B,CAAC,GAAG,EAAE;QAC9B,SAAS,EAAE,CAAC;QAEZ,iCAAiC;IACnC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO,CACL,oBAAC,oBAAoB,IACnB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,YAAY,EACnB,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AVPlaybackSource, AVPlaybackStatus } from "expo-av";
|
|
2
|
+
import React from "react";
|
|
2
3
|
export interface MediaPlayerStatus {
|
|
3
4
|
isPlaying: boolean;
|
|
4
5
|
isLoading: boolean;
|
|
@@ -21,3 +22,8 @@ export interface MediaPlayerProps {
|
|
|
21
22
|
source: AVPlaybackSource;
|
|
22
23
|
}
|
|
23
24
|
export declare function mapToMediaPlayerStatus(status: AVPlaybackStatus): MediaPlayerStatus;
|
|
25
|
+
/**
|
|
26
|
+
* Base64 strings are not playable on iOS and needs to be saved to a file before playing
|
|
27
|
+
*/
|
|
28
|
+
export declare function normalizeBase64Source(source: AVPlaybackSource): Promise<AVPlaybackSource>;
|
|
29
|
+
export declare function useSourceDeepCompareEffect(callback: React.EffectCallback, dependencies: React.DependencyList): void;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import * as FileSystem from "expo-file-system";
|
|
2
|
+
import { v4 as uuid } from "uuid";
|
|
3
|
+
import { Platform } from "react-native";
|
|
4
|
+
import React from "react";
|
|
1
5
|
export function mapToMediaPlayerStatus(status) {
|
|
2
6
|
if (status.isLoaded) {
|
|
3
7
|
return {
|
|
@@ -21,4 +25,43 @@ export function mapToMediaPlayerStatus(status) {
|
|
|
21
25
|
error: status.error,
|
|
22
26
|
};
|
|
23
27
|
}
|
|
28
|
+
// https://stackoverflow.com/a/7874175/8805150
|
|
29
|
+
const BASE_64_REGEX = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
|
30
|
+
/**
|
|
31
|
+
* Base64 strings are not playable on iOS and needs to be saved to a file before playing
|
|
32
|
+
*/
|
|
33
|
+
export async function normalizeBase64Source(source) {
|
|
34
|
+
const uri = source === null || source === void 0 ? void 0 : source.uri;
|
|
35
|
+
if (Platform.OS === "ios" && uri && uri.match(BASE_64_REGEX)) {
|
|
36
|
+
const fileName = `${FileSystem.cacheDirectory}${uuid()}`;
|
|
37
|
+
await FileSystem.writeAsStringAsync(fileName, uri, {
|
|
38
|
+
encoding: FileSystem.EncodingType.Base64,
|
|
39
|
+
});
|
|
40
|
+
return { uri: fileName };
|
|
41
|
+
}
|
|
42
|
+
return source;
|
|
43
|
+
}
|
|
44
|
+
// The source provided into the AudioPlayer can be of type {uri: "some uri"}
|
|
45
|
+
// In the case that this object is created inline, each rerender provides a new source object because a new object is initialized everytime
|
|
46
|
+
// This creates an issue with being a useEffect dependency
|
|
47
|
+
//
|
|
48
|
+
// This creates variants of useEffect that checks deep equality of 'uri' to determine if dependency changed or not
|
|
49
|
+
// Follows: https://stackoverflow.com/a/54096391
|
|
50
|
+
function sourceDeepCompareEquals(a, b) {
|
|
51
|
+
if ((a === null || a === void 0 ? void 0 : a.uri) && (b === null || b === void 0 ? void 0 : b.uri)) {
|
|
52
|
+
return a.uri === b.uri;
|
|
53
|
+
}
|
|
54
|
+
return a === b;
|
|
55
|
+
}
|
|
56
|
+
function useSourceDeepCompareMemoize(value) {
|
|
57
|
+
const ref = React.useRef();
|
|
58
|
+
if (!sourceDeepCompareEquals(value, ref.current)) {
|
|
59
|
+
ref.current = value;
|
|
60
|
+
}
|
|
61
|
+
return ref.current;
|
|
62
|
+
}
|
|
63
|
+
export function useSourceDeepCompareEffect(callback, dependencies) {
|
|
64
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
|
+
React.useEffect(callback, dependencies.map(useSourceDeepCompareMemoize));
|
|
66
|
+
}
|
|
24
67
|
//# sourceMappingURL=MediaPlayerCommon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaPlayerCommon.js","sourceRoot":"","sources":["../../../../../src/components/MediaPlayer/MediaPlayerCommon.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MediaPlayerCommon.js","sourceRoot":"","sources":["../../../../../src/components/MediaPlayer/MediaPlayerCommon.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,MAAM,OAAO,CAAC;AA0B1B,MAAM,UAAU,sBAAsB,CACpC,MAAwB;IAExB,IAAI,MAAM,CAAC,QAAQ,EAAE;QACnB,OAAO;YACL,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,SAAS,EAAE,KAAK;YAChB,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,qBAAqB,EAAE,MAAM,CAAC,cAAc,IAAI,CAAC;YACjD,cAAc,EAAE,MAAM,CAAC,cAAc,IAAI,CAAC;YAC1C,sBAAsB,EAAE,MAAM,CAAC,sBAAsB,IAAI,CAAC;YAC1D,OAAO,EAAE,KAAK;SACf,CAAC;KACH;IAED,OAAO;QACL,SAAS,EAAE,KAAK;QAChB,SAAS,EAAE,KAAK;QAChB,WAAW,EAAE,KAAK;QAClB,qBAAqB,EAAE,CAAC;QACxB,cAAc,EAAE,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AC,EAAE;QAChD,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC;KACrB;IACD,OAAO,GAAG,CAAC,OAAO,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,0BAA0B,CACxC,QAA8B,EAC9B,YAAkC;IAElC,uDAAuD;IACvD,KAAK,CAAC,SAAS,CAAC,QAAQ,EAAE,YAAY,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -2,11 +2,12 @@ import React from "react";
|
|
|
2
2
|
import { Video as VideoPlayerComponent, ResizeMode as ExpoResizeMode, VideoFullscreenUpdate, } from "expo-av";
|
|
3
3
|
import { extractSizeStyles } from "../../../utilities";
|
|
4
4
|
import MediaPlaybackWrapper from "../MediaPlaybackWrapper";
|
|
5
|
-
import { mapToMediaPlayerStatus } from "../MediaPlayerCommon";
|
|
6
|
-
const VideoPlayer = React.forwardRef(({ style, resizeMode = "contain", posterResizeMode = "cover", onPlaybackStatusUpdate: onPlaybackStatusUpdateProp, onPlaybackFinish, ...rest }, ref) => {
|
|
5
|
+
import { mapToMediaPlayerStatus, normalizeBase64Source, useSourceDeepCompareEffect, } from "../MediaPlayerCommon";
|
|
6
|
+
const VideoPlayer = React.forwardRef(({ style, resizeMode = "contain", posterResizeMode = "cover", onPlaybackStatusUpdate: onPlaybackStatusUpdateProp, onPlaybackFinish, source, ...rest }, ref) => {
|
|
7
7
|
const [videoMediaObject, setVideoMediaObject] = React.useState();
|
|
8
8
|
const [isPlaying, setIsPlaying] = React.useState(false);
|
|
9
9
|
const [isFullscreen, setIsFullscreen] = React.useState(false);
|
|
10
|
+
const [currentSource, setCurrentSource] = React.useState();
|
|
10
11
|
const mediaPlaybackWrapperRef = React.useRef(null);
|
|
11
12
|
const sizeStyles = extractSizeStyles(style);
|
|
12
13
|
let mappedResizeMode;
|
|
@@ -64,12 +65,19 @@ const VideoPlayer = React.forwardRef(({ style, resizeMode = "contain", posterRes
|
|
|
64
65
|
// Include 'isPlaying' as dependency because 'togglePlayback' changes when it changes
|
|
65
66
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
66
67
|
[toggleFullscreen, isPlaying]);
|
|
68
|
+
useSourceDeepCompareEffect(() => {
|
|
69
|
+
const updateSource = async () => {
|
|
70
|
+
const finalSource = await normalizeBase64Source(source);
|
|
71
|
+
setCurrentSource(finalSource);
|
|
72
|
+
};
|
|
73
|
+
updateSource();
|
|
74
|
+
}, [source]);
|
|
67
75
|
return (React.createElement(MediaPlaybackWrapper, { media: videoMediaObject, isPlaying: isPlaying, ref: mediaPlaybackWrapperRef },
|
|
68
76
|
React.createElement(VideoPlayerComponent
|
|
69
77
|
// https://docs.expo.dev/versions/latest/sdk/av/#example-video to see why ref is handled this way
|
|
70
78
|
, {
|
|
71
79
|
// https://docs.expo.dev/versions/latest/sdk/av/#example-video to see why ref is handled this way
|
|
72
|
-
ref: (component) => setVideoMediaObject(component), style: style, videoStyle: sizeStyles, resizeMode: mappedResizeMode, posterStyle: [sizeStyles, { resizeMode: posterResizeMode }], onPlaybackStatusUpdate: onPlaybackStatusUpdate, onFullscreenUpdate: (e) => onFullscreenUpdate(e.fullscreenUpdate), ...rest })));
|
|
80
|
+
ref: (component) => setVideoMediaObject(component), style: style, videoStyle: sizeStyles, resizeMode: mappedResizeMode, posterStyle: [sizeStyles, { resizeMode: posterResizeMode }], onPlaybackStatusUpdate: onPlaybackStatusUpdate, onFullscreenUpdate: (e) => onFullscreenUpdate(e.fullscreenUpdate), source: currentSource, ...rest })));
|
|
73
81
|
});
|
|
74
82
|
export default VideoPlayer;
|
|
75
83
|
//# sourceMappingURL=VideoPlayer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoPlayer.js","sourceRoot":"","sources":["../../../../../../src/components/MediaPlayer/VideoPlayer/VideoPlayer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,KAAK,IAAI,oBAAoB,EAE7B,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