From bce32edc3513fdc1858d7d7d182f48e0e1eb0c85 Mon Sep 17 00:00:00 2001 From: Xin Yao Date: Mon, 19 Jul 2021 12:14:59 -0700 Subject: [PATCH] Initial video support --- example/assets/sample_data.json | 5 +++++ lib/src/models/documents/nodes/embed.dart | 3 +++ 2 files changed, 8 insertions(+) diff --git a/example/assets/sample_data.json b/example/assets/sample_data.json index a0b44f50..685b833a 100644 --- a/example/assets/sample_data.json +++ b/example/assets/sample_data.json @@ -17,6 +17,11 @@ "style":"display: block; margin: auto;" } }, + { + "insert": { + "video": "https://www.youtube.com/watch?v=V4hgdKhIqtc&list=PLbhaS_83B97s78HsDTtplRTEhcFsqSqIK&index=1" + } + }, { "insert":"\nRich text editor for Flutter" }, diff --git a/lib/src/models/documents/nodes/embed.dart b/lib/src/models/documents/nodes/embed.dart index 07e6a6b3..18c550fe 100644 --- a/lib/src/models/documents/nodes/embed.dart +++ b/lib/src/models/documents/nodes/embed.dart @@ -39,4 +39,7 @@ class BlockEmbed extends Embeddable { static const String imageType = 'image'; static BlockEmbed image(String imageUrl) => BlockEmbed(imageType, imageUrl); + + static const String videoType = 'video'; + static BlockEmbed video(String videoUrl) => BlockEmbed(videoType, videoUrl); }