|
5 | 5 | HORIZONTAL_THUMBNAIL_URL = 'https://via.placeholder.com/1024x768'
|
6 | 6 | QUICK_REPLY_ICON_URL = 'https://via.placeholder.com/64x64'
|
7 | 7 |
|
| 8 | +set :app_base_url, ENV['APP_BASE_URL'] |
| 9 | + |
8 | 10 | def client
|
9 | 11 | @client ||= Line::Bot::Client.new do |config|
|
10 | 12 | config.channel_secret = ENV["LINE_CHANNEL_SECRET"]
|
@@ -255,6 +257,36 @@ def handle_message(event)
|
255 | 257 | ]
|
256 | 258 | })
|
257 | 259 |
|
| 260 | + when 'imagemap video' |
| 261 | + video_url = File.join(settings.app_base_url.to_s, 'imagemap/video.mp4') |
| 262 | + preview_url = File.join(settings.app_base_url.to_s, 'imagemap/preview.jpg') |
| 263 | + reply_content(event, { |
| 264 | + type: 'imagemap', |
| 265 | + baseUrl: THUMBNAIL_URL, |
| 266 | + altText: 'Imagemap alt text', |
| 267 | + baseSize: { width: 1040, height: 1040 }, |
| 268 | + video: { |
| 269 | + originalContentUrl: video_url, |
| 270 | + previewImageUrl: preview_url, |
| 271 | + area: { |
| 272 | + x: 0, |
| 273 | + y: 0, |
| 274 | + width: 520, |
| 275 | + height: 520, |
| 276 | + }, |
| 277 | + external_link: { |
| 278 | + linkUri: 'https://line.me', |
| 279 | + label: 'LINE', |
| 280 | + }, |
| 281 | + }, |
| 282 | + actions: [ |
| 283 | + { area: { x: 0, y: 0, width: 512, height: 512 }, type: 'uri', linkUri: 'https://store.line.me/family/manga/en' }, |
| 284 | + { area: { x: 512, y: 0, width: 512, height: 512 }, type: 'uri', linkUri: 'https://store.line.me/family/music/en' }, |
| 285 | + { area: { x: 0, y: 512, width: 512, height: 512 }, type: 'uri', linkUri: 'https://store.line.me/family/play/en' }, |
| 286 | + { area: { x: 512, y: 512, width: 512, height: 512 }, type: 'message', text: 'Fortune!' }, |
| 287 | + ] |
| 288 | + }) |
| 289 | + |
258 | 290 | when 'flex'
|
259 | 291 | reply_content(event, {
|
260 | 292 | type: "flex",
|
|
0 commit comments