Skip to content

Commit a153ff2

Browse files
authored
Merge pull request #42 from janniks/allow-fullscreen-video-embed
Add embed allows with fullscreen default
2 parents d3750e6 + 1399ee3 commit a153ff2

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

docs/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ The `NotionRenderer` component offers a few properties
1414

1515
- [`blockMap`](#blockMap) – required
1616
- [`contentId`](#contentId) – default: `undefined`
17+
- [`embedAllow`](#embedAllow) – default: `fullscreen`
1718
- [`fullPage`](#fullPage) – default: `false`
1819
- [`hideList`](#hideList) – default: `[]`
1920
- [`mapImageUrl`](#mapImageUrl) – default: `defaultMapImageUrl()`
@@ -31,6 +32,11 @@ A list of blocks by their id that may contain contents and properties.
3132
If this is `undefined` the _first_ block is rendered.
3233
_Usually the first block contains the rest of the page._
3334

35+
### `embedAllow`: String
36+
37+
– the [`allow` feature policy](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-allow) for embedded `<iframe>`s (e.g. YouTube videos).
38+
The default allows embeds to enter fullscreen.
39+
3440
### `fullPage`: Boolean
3541

3642
– wether or not the page should contain the cover and header.

src/blocks/helpers/asset.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div :style="style">
3-
<iframe class="notion-image-inset" :src="src" />
3+
<iframe class="notion-image-inset" :src="src" :allow="embedAllow" />
44
</div>
55
</template>
66

src/lib/blockable.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { getTextContent } from "@/lib/utils";
33
export const blockProps = {
44
blockMap: { type: Object, required: true },
55
contentId: { type: String, required: false },
6+
embedAllow: { type: String, default: "fullscreen" },
67
fullPage: { type: Boolean, default: false },
78
hideList: { type: Array, default: () => [] },
89
level: { type: Number, default: 0 },
@@ -19,6 +20,7 @@ export const blockComputed = {
1920
return {
2021
blockMap: this.blockMap,
2122
contentId: this.contentId,
23+
embedAllow: this.embedAllow,
2224
fullPage: this.fullPage,
2325
hideList: this.hideList,
2426
level: this.level,

0 commit comments

Comments
 (0)