Skip to content

Commit

Permalink
use dynamic import for video content
Browse files Browse the repository at this point in the history
  • Loading branch information
yuheiy committed Jul 22, 2024
1 parent cf037a4 commit fd47589
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 1 addition & 4 deletions src/content/blog/2022-08-11-text-with-accompanying-icon.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pubDate: 2022-08-11T20:25:00.000+09:00
---

import { Tweet } from 'astro-embed';

import { Image } from 'astro:assets';

テキストの行の末尾にアイコンを付随させるというレイアウトがある。
Expand Down Expand Up @@ -62,11 +61,9 @@ import { Image } from 'astro:assets';
}
```

import _3Video from './assets/2022-08-11-text-with-accompanying-icon/3.mp4';

<figure>
<video controls playsinline style="width: calc(1560/2/16*1rem);">
<source src={_3Video} />
<source src={(await import('./assets/2022-08-11-text-with-accompanying-icon/3.mp4')).default} />
</video>
</figure>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,14 @@ metadata(`meta`)として指定された値はstoryに継承されるため

これによって、controlledなコンポーネントを操作可能なstoryをを作成できる。ただしこの実装では、Storybookのcontrolsからargsの値を制御できなくなってしまう。

import withoutUseArgsVideo from './assets/2024-07-09-controlled-components-in-storybook/without-useargs.mp4';

<figure>
<video controls playsinline>
<source src={withoutUseArgsVideo} />
<source
src={
(await import('./assets/2024-07-09-controlled-components-in-storybook/without-useargs.mp4'))
.default
}
/>
</video>
</figure>

Expand Down

0 comments on commit fd47589

Please sign in to comment.