|
@@ -119,7 +119,7 @@ export const addFrame = (
|
|
|
const stopLoad = watch(
|
|
|
() => {
|
|
|
const exists = am.frames.some(({ id }) => id === data.id);
|
|
|
- amMap[key].am
|
|
|
+ amMap[key]?.am
|
|
|
return [amMap[key], exists] as const;
|
|
|
},
|
|
|
([map, exists]) => {
|
|
@@ -176,7 +176,7 @@ export const addAction = (
|
|
|
const stopLoad = watch(
|
|
|
() => {
|
|
|
const exists = am.actions.some(({ id }) => id === data.id);
|
|
|
- amMap[key].am
|
|
|
+ amMap[key]?.am
|
|
|
return [amMap[key], exists] as const;
|
|
|
},
|
|
|
([map, exists]) => {
|
|
@@ -301,7 +301,7 @@ export const addSubtitle = (data: AnimationModelSubtitle) => {
|
|
|
const stopLoad = watch(
|
|
|
() => {
|
|
|
const exists = am.subtitles.some(({ id }) => id === data.id);
|
|
|
- amMap[key].am
|
|
|
+ amMap[key]?.am
|
|
|
return [amMap[key], exists] as const;
|
|
|
},
|
|
|
([map, exists]) => {
|
|
@@ -329,7 +329,7 @@ export const addSubtitle = (data: AnimationModelSubtitle) => {
|
|
|
|
|
|
const stopAttrib = mergeFuns(
|
|
|
watch(
|
|
|
- [currentTime, () => amMap[am.id].am, size, play],
|
|
|
+ [currentTime, () => amMap[am.id]?.am, size, play],
|
|
|
(_a, _b, onCleanup) => {
|
|
|
if (
|
|
|
!play.value &&
|
|
@@ -341,7 +341,7 @@ export const addSubtitle = (data: AnimationModelSubtitle) => {
|
|
|
currentTime.value <= data.time + data.duration
|
|
|
) {
|
|
|
const update = () =>
|
|
|
- (pixel.value = amMap[am.id].am?.getCurrentSubtitlePixel(
|
|
|
+ (pixel.value = amMap[am.id]?.am?.getCurrentSubtitlePixel(
|
|
|
size.value
|
|
|
));
|
|
|
update();
|
|
@@ -400,7 +400,6 @@ watch(play, (_a, _b, onCleanup) => {
|
|
|
|
|
|
export const currentTime = ref(0);
|
|
|
export const associationAnimation = (sdk: SDK, el: HTMLDivElement) => {
|
|
|
- console.error('join animation-group')
|
|
|
animationGroup = sdk.createAnimationGroup();
|
|
|
|
|
|
watchEffect(() => {
|