2017-04-26 11 views
0

こんにちは、私はthymeleafでバックグラウンドミュージックを再生するにはどうすればいいですか?基本的な方法はthymeleafのバックグラウンドミュージック

<audio controls> 
    <source src="/static/hikariare.mp3" type="audio/mpeg"> 
</audio> 

を失い、私はこのような何かを得る:そのようなほとんどの属性について

org.xml.sax.SAXParseException: Attribute name "controls" associated with an element type "audio" must be followed by the ' = ' character. 

答えて

0

(必要に応じ、コントロール、など)XHTMLで、あなたがこのようにそれらを設定する必要があります。 (あなたはおそらく同様にソースタグを終了する必要があります。)

<audio controls="controls"> 
    <source src="/static/hikariare.mp3" type="audio/mpeg"></source> 
</audio> 
+0

男のおかげでああ、あなたは私の一日行われ – Shinzoo

0

をあなたは春ブーツとspring-boot-starter-thymeleaf依存関係を使用する場合は、あなたがあなたのpom.xml

<properties> 
    <thymeleaf.version>3.0.2.RELEASE</thymeleaf.version> 
    <thymeleaf-layout-dialect.version>2.1.1</thymeleaf-layout-dialect.version> 
</properties> 

を追加する必要があります。

デフォルトThymeleaf 2のみHTML/XHMTLではなく、純粋なHTML5をサポートしていますThymeleaf 3を使用するには、この力の達人は、(<audio controls>がHTML5である)、ここで

詳細情報:https://docs.spring.io/spring-boot/docs/current/reference/html/howto-spring-mvc.html#howto-use-thymeleaf-3

関連する問題