Skip to content

Commit 6309020

Browse files
author
Hyunje Jun
authored
Implement video in imagemap (#100)
* Add type for video in imagemap message * [kitchensink] Add example code for video in imagemap
1 parent ebbe88e commit 6309020

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

examples/kitchensink/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,20 @@ function handleText(message, replyToken, source) {
256256
{ area: { x: 0, y: 520, width: 520, height: 520 }, type: 'uri', linkUri: 'https://store.line.me/family/play/en' },
257257
{ area: { x: 520, y: 520, width: 520, height: 520 }, type: 'message', text: 'URANAI!' },
258258
],
259+
video: {
260+
originalContentUrl: `${baseURL}/static/imagemap/video.mp4`,
261+
previewImageUrl: `${baseURL}/static/imagemap/preview.jpg`,
262+
area: {
263+
x: 280,
264+
y: 385,
265+
width: 480,
266+
height: 270,
267+
},
268+
externalLink: {
269+
linkUri: 'https://line.me',
270+
label: 'LINE'
271+
}
272+
},
259273
}
260274
);
261275
case 'bye':
80.2 KB
Loading
1.73 MB
Binary file not shown.

lib/types.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,40 @@ export type ImageMapMessage = MessageCommon & {
417417
*/
418418
altText: string;
419419
baseSize: Size;
420+
/**
421+
* Video to play inside a image map messagea
422+
*/
423+
video?: {
424+
/**
425+
* URL of video file (Max: 1000 characters)
426+
*
427+
* - **HTTPS**
428+
* - mp4
429+
* - Max: 1 minute
430+
* - Max: 10 MB
431+
*
432+
* A very wide or tall video may be cropped when played in some environments.
433+
*/
434+
originalContentUrl: string;
435+
/**
436+
* URL of preview image (Max: 1000 characters)
437+
*
438+
* - **HTTPS**
439+
* - JPEG
440+
* - Max: 240 x 240
441+
* - Max: 1 MB
442+
*/
443+
previewImageUrl: string;
444+
area: Area;
445+
/**
446+
* External link to be displayed after a video is played
447+
* This property is required if you set a video to play and a label to display after the video on the imagemap
448+
*/
449+
externalLink?: {
450+
linkUri: string;
451+
label: string;
452+
};
453+
};
420454
/**
421455
* Action when tapped (Max: 50)
422456
*/

0 commit comments

Comments
 (0)