html_compose.attributes.audio_attrs
1from . import BaseAttribute 2from typing import Literal 3 4 5class AudioAttrs: 6 """ 7 This module contains functions for attributes in the 'audio' element. 8 Which is inherited by a class so we can generate type hints 9 """ 10 11 @staticmethod 12 def autoplay(value: bool) -> BaseAttribute: 13 """ 14 "audio" attribute: autoplay 15 Hint that the media resource can be started automatically when the page is loaded 16 17 Args: 18 value: 19 Boolean attribute 20 21 Returns: 22 An autoplay attribute to be added to your element 23 24 """ 25 26 return BaseAttribute("autoplay", value) 27 28 @staticmethod 29 def controls(value: bool) -> BaseAttribute: 30 """ 31 "audio" attribute: controls 32 Show user agent controls 33 34 Args: 35 value: 36 Boolean attribute 37 38 Returns: 39 An controls attribute to be added to your element 40 41 """ 42 43 return BaseAttribute("controls", value) 44 45 @staticmethod 46 def crossorigin( 47 value: Literal["anonymous", "use-credentials"], 48 ) -> BaseAttribute: 49 """ 50 "audio" attribute: crossorigin 51 How the element handles crossorigin requests 52 53 Args: 54 value: 55 ['anonymous', 'use-credentials'] 56 57 Returns: 58 An crossorigin attribute to be added to your element 59 60 """ 61 62 return BaseAttribute("crossorigin", value) 63 64 @staticmethod 65 def loop(value: bool) -> BaseAttribute: 66 """ 67 "audio" attribute: loop 68 Whether to loop the media resource 69 70 Args: 71 value: 72 Boolean attribute 73 74 Returns: 75 An loop attribute to be added to your element 76 77 """ 78 79 return BaseAttribute("loop", value) 80 81 @staticmethod 82 def muted(value: bool) -> BaseAttribute: 83 """ 84 "audio" attribute: muted 85 Whether to mute the media resource by default 86 87 Args: 88 value: 89 Boolean attribute 90 91 Returns: 92 An muted attribute to be added to your element 93 94 """ 95 96 return BaseAttribute("muted", value) 97 98 @staticmethod 99 def preload(value: Literal["none", "metadata", "auto"]) -> BaseAttribute: 100 """ 101 "audio" attribute: preload 102 Hints how much buffering the media resource will likely need 103 104 Args: 105 value: 106 ['none', 'metadata', 'auto'] 107 108 Returns: 109 An preload attribute to be added to your element 110 111 """ 112 113 return BaseAttribute("preload", value) 114 115 @staticmethod 116 def src(value) -> BaseAttribute: 117 """ 118 "audio" attribute: src 119 Address of the resource 120 121 Args: 122 value: 123 Valid non-empty URL potentially surrounded by spaces 124 125 Returns: 126 An src attribute to be added to your element 127 128 """ 129 130 return BaseAttribute("src", value)
6class AudioAttrs: 7 """ 8 This module contains functions for attributes in the 'audio' element. 9 Which is inherited by a class so we can generate type hints 10 """ 11 12 @staticmethod 13 def autoplay(value: bool) -> BaseAttribute: 14 """ 15 "audio" attribute: autoplay 16 Hint that the media resource can be started automatically when the page is loaded 17 18 Args: 19 value: 20 Boolean attribute 21 22 Returns: 23 An autoplay attribute to be added to your element 24 25 """ 26 27 return BaseAttribute("autoplay", value) 28 29 @staticmethod 30 def controls(value: bool) -> BaseAttribute: 31 """ 32 "audio" attribute: controls 33 Show user agent controls 34 35 Args: 36 value: 37 Boolean attribute 38 39 Returns: 40 An controls attribute to be added to your element 41 42 """ 43 44 return BaseAttribute("controls", value) 45 46 @staticmethod 47 def crossorigin( 48 value: Literal["anonymous", "use-credentials"], 49 ) -> BaseAttribute: 50 """ 51 "audio" attribute: crossorigin 52 How the element handles crossorigin requests 53 54 Args: 55 value: 56 ['anonymous', 'use-credentials'] 57 58 Returns: 59 An crossorigin attribute to be added to your element 60 61 """ 62 63 return BaseAttribute("crossorigin", value) 64 65 @staticmethod 66 def loop(value: bool) -> BaseAttribute: 67 """ 68 "audio" attribute: loop 69 Whether to loop the media resource 70 71 Args: 72 value: 73 Boolean attribute 74 75 Returns: 76 An loop attribute to be added to your element 77 78 """ 79 80 return BaseAttribute("loop", value) 81 82 @staticmethod 83 def muted(value: bool) -> BaseAttribute: 84 """ 85 "audio" attribute: muted 86 Whether to mute the media resource by default 87 88 Args: 89 value: 90 Boolean attribute 91 92 Returns: 93 An muted attribute to be added to your element 94 95 """ 96 97 return BaseAttribute("muted", value) 98 99 @staticmethod 100 def preload(value: Literal["none", "metadata", "auto"]) -> BaseAttribute: 101 """ 102 "audio" attribute: preload 103 Hints how much buffering the media resource will likely need 104 105 Args: 106 value: 107 ['none', 'metadata', 'auto'] 108 109 Returns: 110 An preload attribute to be added to your element 111 112 """ 113 114 return BaseAttribute("preload", value) 115 116 @staticmethod 117 def src(value) -> BaseAttribute: 118 """ 119 "audio" attribute: src 120 Address of the resource 121 122 Args: 123 value: 124 Valid non-empty URL potentially surrounded by spaces 125 126 Returns: 127 An src attribute to be added to your element 128 129 """ 130 131 return BaseAttribute("src", value)
This module contains functions for attributes in the 'audio' element. Which is inherited by a class so we can generate type hints
12 @staticmethod 13 def autoplay(value: bool) -> BaseAttribute: 14 """ 15 "audio" attribute: autoplay 16 Hint that the media resource can be started automatically when the page is loaded 17 18 Args: 19 value: 20 Boolean attribute 21 22 Returns: 23 An autoplay attribute to be added to your element 24 25 """ 26 27 return BaseAttribute("autoplay", value)
"audio" attribute: autoplay Hint that the media resource can be started automatically when the page is loaded
Args: value: Boolean attribute
Returns: An autoplay attribute to be added to your element
29 @staticmethod 30 def controls(value: bool) -> BaseAttribute: 31 """ 32 "audio" attribute: controls 33 Show user agent controls 34 35 Args: 36 value: 37 Boolean attribute 38 39 Returns: 40 An controls attribute to be added to your element 41 42 """ 43 44 return BaseAttribute("controls", value)
"audio" attribute: controls Show user agent controls
Args: value: Boolean attribute
Returns: An controls attribute to be added to your element
46 @staticmethod 47 def crossorigin( 48 value: Literal["anonymous", "use-credentials"], 49 ) -> BaseAttribute: 50 """ 51 "audio" attribute: crossorigin 52 How the element handles crossorigin requests 53 54 Args: 55 value: 56 ['anonymous', 'use-credentials'] 57 58 Returns: 59 An crossorigin attribute to be added to your element 60 61 """ 62 63 return BaseAttribute("crossorigin", value)
"audio" attribute: crossorigin How the element handles crossorigin requests
Args: value: ['anonymous', 'use-credentials']
Returns: An crossorigin attribute to be added to your element
65 @staticmethod 66 def loop(value: bool) -> BaseAttribute: 67 """ 68 "audio" attribute: loop 69 Whether to loop the media resource 70 71 Args: 72 value: 73 Boolean attribute 74 75 Returns: 76 An loop attribute to be added to your element 77 78 """ 79 80 return BaseAttribute("loop", value)
"audio" attribute: loop Whether to loop the media resource
Args: value: Boolean attribute
Returns: An loop attribute to be added to your element
82 @staticmethod 83 def muted(value: bool) -> BaseAttribute: 84 """ 85 "audio" attribute: muted 86 Whether to mute the media resource by default 87 88 Args: 89 value: 90 Boolean attribute 91 92 Returns: 93 An muted attribute to be added to your element 94 95 """ 96 97 return BaseAttribute("muted", value)
"audio" attribute: muted Whether to mute the media resource by default
Args: value: Boolean attribute
Returns: An muted attribute to be added to your element
99 @staticmethod 100 def preload(value: Literal["none", "metadata", "auto"]) -> BaseAttribute: 101 """ 102 "audio" attribute: preload 103 Hints how much buffering the media resource will likely need 104 105 Args: 106 value: 107 ['none', 'metadata', 'auto'] 108 109 Returns: 110 An preload attribute to be added to your element 111 112 """ 113 114 return BaseAttribute("preload", value)
"audio" attribute: preload Hints how much buffering the media resource will likely need
Args: value: ['none', 'metadata', 'auto']
Returns: An preload attribute to be added to your element
116 @staticmethod 117 def src(value) -> BaseAttribute: 118 """ 119 "audio" attribute: src 120 Address of the resource 121 122 Args: 123 value: 124 Valid non-empty URL potentially surrounded by spaces 125 126 Returns: 127 An src attribute to be added to your element 128 129 """ 130 131 return BaseAttribute("src", value)
"audio" attribute: src Address of the resource
Args: value: Valid non-empty URL potentially surrounded by spaces
Returns: An src attribute to be added to your element