瀏覽代碼

Merge pull request #1851 from astone123/master

Fix data-background-video autoplay on iOS Safari
Hakim El Hattab 8 年之前
父節點
當前提交
2289b92961
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      js/reveal.js

+ 3 - 1
js/reveal.js

@@ -1462,7 +1462,7 @@
 	 * target element.
 	 *
 	 * remaining height = [ configured parent height ] - [ current parent height ]
-	 * 
+	 *
 	 * @param {HTMLElement} element
 	 * @param {number} [height]
 	 */
@@ -3113,6 +3113,8 @@
 				// Videos
 				else if ( backgroundVideo && !isSpeakerNotes() ) {
 					var video = document.createElement( 'video' );
+					video.setAttribute( 'autoplay', '' );
+					video.setAttribute( 'playsinline', '' );
 
 					if( backgroundVideoLoop ) {
 						video.setAttribute( 'loop', '' );