@@ -93,6 +93,7 @@ def __init__(self, size=None, direction=None, header=None, hero=None,
93
93
:param hero: Hero block
94
94
:type hero: :py:class:`linebot.models.flex_message.ImageComponent`
95
95
| :py:class:`linebot.models.flex_message.BoxComponent`
96
+ | :py:class:`linebot.models.flex_message.VideoComponent`
96
97
:param body: Body block
97
98
:type body: :py:class:`linebot.models.flex_message.BoxComponent`
98
99
:param footer: Footer block
@@ -112,7 +113,8 @@ def __init__(self, size=None, direction=None, header=None, hero=None,
112
113
self .hero = self .get_or_new_from_json_dict_with_types (
113
114
hero , {
114
115
'image' : ImageComponent ,
115
- 'box' : BoxComponent
116
+ 'box' : BoxComponent ,
117
+ 'video' : VideoComponent
116
118
}
117
119
)
118
120
self .body = self .get_or_new_from_json_dict (body , BoxComponent )
@@ -238,7 +240,9 @@ def __init__(self,
238
240
align_items = None ,
239
241
background = None ,
240
242
width = None ,
243
+ max_width = None ,
241
244
height = None ,
245
+ max_height = None ,
242
246
flex = None ,
243
247
spacing = None ,
244
248
margin = None ,
@@ -270,7 +274,9 @@ def __init__(self,
270
274
:param background: Background object
271
275
:type background: T <= :py:class:`linebot.models.background.Background`
272
276
:param str width: Width of the box
277
+ :param str max_width: Maximum width of the box
273
278
:param str height: Height of the box
279
+ :param str max_height: Maximum height of the box
274
280
:param float flex: The ratio of the width or height of this box within the parent box
275
281
and the previous component in the parent box
276
282
:param str spacing: Minimum space between components in this box
@@ -303,7 +309,9 @@ def __init__(self,
303
309
self .justify_content = justify_content
304
310
self .align_items = align_items
305
311
self .width = width
312
+ self .max_width = max_width
306
313
self .height = height
314
+ self .max_height = max_height
307
315
self .flex = flex
308
316
self .spacing = spacing
309
317
self .margin = margin
@@ -334,7 +342,8 @@ def __init__(self,
334
342
'image' : ImageComponent ,
335
343
'span' : SpanComponent ,
336
344
'separator' : SeparatorComponent ,
337
- 'text' : TextComponent
345
+ 'text' : TextComponent ,
346
+ 'video' : VideoComponent
338
347
}
339
348
))
340
349
self .contents = new_contents
@@ -615,6 +624,7 @@ def __init__(self,
615
624
align = None ,
616
625
gravity = None ,
617
626
wrap = None ,
627
+ line_spacing = None ,
618
628
max_lines = None ,
619
629
weight = None ,
620
630
color = None ,
@@ -640,6 +650,7 @@ def __init__(self,
640
650
:param str gravity: Vertical alignment style
641
651
:param bool wrap: rue to wrap text. The default value is False.
642
652
If set to True, you can use a new line character (\n) to begin on a new line.
653
+ :param str line_spacing: Line spacing in a wrapping text
643
654
:param int max_lines: Max number of lines
644
655
:param str weight: Font weight
645
656
:param str color: Font color
@@ -663,6 +674,7 @@ def __init__(self,
663
674
self .align = align
664
675
self .gravity = gravity
665
676
self .wrap = wrap
677
+ self .line_spacing = line_spacing
666
678
self .max_lines = max_lines
667
679
self .weight = weight
668
680
self .color = color
@@ -674,3 +686,45 @@ def __init__(self,
674
686
self .contents = [self .get_or_new_from_json_dict (it , SpanComponent ) for it in contents ]
675
687
else :
676
688
self .contents = None
689
+
690
+
691
+ class VideoComponent (FlexComponent ):
692
+ """VideoComponent.
693
+
694
+ https://developers.line.biz/en/reference/messaging-api/#f-video
695
+
696
+ This component renders a video.
697
+ """
698
+
699
+ def __init__ (self ,
700
+ url = None ,
701
+ preview_url = None ,
702
+ alt_content = None ,
703
+ aspect_ratio = None ,
704
+ action = None ,
705
+ ** kwargs ):
706
+ r"""__init__ method.
707
+
708
+ :param str url: URL of video file
709
+ :param str preview_url: URL of preview image
710
+ :param alt_content: Alternative content
711
+ :type alt_content: :py:class:`linebot.models.flex_message.ImageComponent`
712
+ | :py:class:`linebot.models.flex_message.BoxComponent`
713
+ :param float aspect_ratio: Aspect ratio of the video
714
+ :param action: Action performed when this video is tapped
715
+ :type action: list[T <= :py:class:`linebot.models.actions.Action`]
716
+ :param kwargs:
717
+ """
718
+ super (VideoComponent , self ).__init__ (** kwargs )
719
+
720
+ self .type = 'video'
721
+ self .url = url
722
+ self .preview_url = preview_url
723
+ self .alt_content = self .get_or_new_from_json_dict_with_types (
724
+ alt_content , {
725
+ 'image' : ImageComponent ,
726
+ 'box' : BoxComponent
727
+ }
728
+ )
729
+ self .aspect_ratio = aspect_ratio
730
+ self .action = get_action (action )
0 commit comments