{"id":3475,"date":"2013-10-21T18:57:00","date_gmt":"2013-10-21T13:27:00","guid":{"rendered":"http:\/\/live-42gears-site.pantheonsite.io\/blog\/?p=3475"},"modified":"2023-01-06T05:37:01","modified_gmt":"2023-01-06T05:37:01","slug":"how-to-auto-play-and-loop-audio-and-video-files-in-android","status":"publish","type":"post","link":"https:\/\/www.42gears.com\/de\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/","title":{"rendered":"How to Auto-Play and Loop Audio and Video files in Android?"},"content":{"rendered":"<table border=\"0\" width=\"210\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td style=\"text-align: left;\" colspan=\"2\" width=\"128\" height=\"20\"><span style=\"color: #585858; font-size: small;\"><strong><span style=\"text-decoration: underline;\">Applies to<\/span>:<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td height=\"20\"><span style=\"color: #0080ff; font-size: small;\"><strong>Product<\/strong><\/span><\/td>\n<td height=\"20\"><strong><span style=\"color: #fe8f8f; font-size: small;\">General<\/span><\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\" height=\"20\"><span style=\"color: #0080ff; font-size: small;\"><strong>Platform<\/strong><\/span><\/td>\n<td height=\"20\"><strong><span style=\"color: #fe8f8f; font-size: small;\">Android<\/span><\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The Auto-play and Loop functions in Android is disabled to minimize the user bandwidth however this post may offer you some help if trying to find a quick fix for this problem.<\/p>\n<p>All you &nbsp;have to do is to follow following two easy steps.<\/p>\n<p>1. Use following script for your HTML file &#8211;<\/p>\n<p><em><span style=\"color: #013adf;\">function onPageLoad()<br \/>\n{<br \/>\nloadVideo();<br \/>\nloadAudio();<br \/>\n}<\/span><\/em><\/p>\n<p><em><span style=\"color: #013adf;\">function loadVideo()<br \/>\n{<br \/>\ndocument.getElementById(&#8222;sampleVideo&#8220;).src = &#8222;.\/surefox.mp4&#8220;;<br \/>\ndocument.getElementById(&#8222;sampleVideo&#8220;).load();<br \/>\nstartPlayingvideo();<br \/>\n}<\/span><\/em><\/p>\n<p><em><span style=\"color: #013adf;\">function loadAudio()<br \/>\n{<br \/>\ndocument.getElementById(&#8222;sampleAudio&#8220;).src = &#8222;.\/surefox.mp3&#8220;;<br \/>\ndocument.getElementById(&#8222;sampleAudio&#8220;).load();<br \/>\nstartPlayingaudio();<br \/>\n}<\/span><\/em><\/p>\n<p><span style=\"color: #013adf;\"><em>function startPlayingaudio()<\/em><br \/>\n<em> {<\/em><br \/>\n<em> \/\/Keep looping the same audio<\/em><br \/>\n<em> setTimeout(function() { document.getElementById(&#8222;sampleAudio&#8220;).play(); },100);<\/em><br \/>\n<em> }<\/em><br \/>\n<em> function startPlayingvideo()<\/em><br \/>\n<em> {<\/em><br \/>\n<em> \/\/Keep looping the same Video<\/em><br \/>\n<em> setTimeout(function() { document.getElementById(&#8222;sampleVideo&#8220;).play(); },100);<\/em><br \/>\n<em> }<\/em><\/span><\/p>\n<p><strong>Note<\/strong> &#8211; Change the name of the audio and video file accordingly and make necessary changes if using only video or only audio files.<\/p>\n<p>2. For the body of the HTML file, use following &#8211;<\/p>\n<p><span style=\"color: #013adf;\">&lt;body onload=&#8220;onPageLoad()&#8220;&gt;<br \/>\n&lt;div style=&#8220;width:10px;height:310px;padding:5px;&#8220;&gt;<br \/>\n&lt;video id=&#8220;sampleVideo&#8220; style=&#8220;width:300px;height:300px;&#8220; controls=&#8220;controls&#8220; onended=&#8220;startPlayingvideo()&#8220; &gt;&lt;\/video&gt;<br \/>\n&lt;audio id=&#8220;sampleAudio&#8220; style=&#8220;width:300px;height:300px;&#8220; controls=&#8220;controls&#8220; onended=&#8220;startPlayingaudio()&#8220; &gt;&lt;\/audio&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/body&gt;<\/span><\/p>\n<p>For quick check, download a sample file by clicking&nbsp;<a href=\"http:\/\/live-42gears-site.pantheonsite.io\/wp-content\/uploads\/2017\/06\/autoplayaudio.zip\">click here<\/a>.<\/p>\n<p>For any questions, do feel free to reach us on&nbsp;&nbsp;<a href=\"mailto:techsupport@42gears.com?subject=Technical%20Support\"><span style=\"color: #0000ff;\">techsupport@42gears.com<\/span><\/a>.<\/p>\n<p><span style=\"color: #013adf;\"><br \/>\n<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Applies to: Product General Platform Android The Auto-play and Loop functions in Android is disabled to minimize the user bandwidth however this post may offer you some help if trying to find a quick fix for this problem. All you &nbsp;have to do is to follow following two easy steps. 1. Use following script for&hellip;<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[9,39,8,16,1],"tags":[174,127,175,99],"class_list":["post-3475","post","type-post","status-publish","format-standard","hentry","category-android","category-development","category-general","category-surefox","category-uncategorized","tag-audio","tag-automatic-video-looping","tag-script","tag-video"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v24.6 (Yoast SEO v24.6) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Auto-Play and Loop Audio and Video files in Android? - 42Gears Mobility Systems<\/title>\n<meta name=\"description\" content=\"42Gear&#039;s blog has everything you need to future-proof your business. Need to auto-play or loop your audio\/video files on Android?\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Auto-Play and Loop Audio and Video files in Android?\" \/>\n<meta property=\"og:description\" content=\"42Gear&#039;s blog has everything you need to future-proof your business. Need to auto-play or loop your audio\/video files on Android?\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/\" \/>\n<meta property=\"og:site_name\" content=\"42Gears Mobility Systems\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/42gears\" \/>\n<meta property=\"article:published_time\" content=\"2013-10-21T13:27:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-06T05:37:01+00:00\" \/>\n<meta name=\"author\" content=\"42Gears Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@42Gears\" \/>\n<meta name=\"twitter:site\" content=\"@42Gears\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"42Gears Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/\"},\"author\":{\"name\":\"42Gears Team\",\"@id\":\"https:\/\/www.42gears.com\/#\/schema\/person\/28a14f2c32de4a7903ac672579a88a2d\"},\"headline\":\"How to Auto-Play and Loop Audio and Video files in Android?\",\"datePublished\":\"2013-10-21T13:27:00+00:00\",\"dateModified\":\"2023-01-06T05:37:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/\"},\"wordCount\":242,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/www.42gears.com\/#organization\"},\"keywords\":[\"audio\",\"automatic video looping\",\"script\",\"video\"],\"articleSection\":[\"Android\",\"Development\",\"General\",\"SureFox\",\"Uncategorized\"],\"inLanguage\":\"de-DE\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/\",\"url\":\"https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/\",\"name\":\"How to Auto-Play and Loop Audio and Video files in Android? - 42Gears Mobility Systems\",\"isPartOf\":{\"@id\":\"https:\/\/www.42gears.com\/#website\"},\"datePublished\":\"2013-10-21T13:27:00+00:00\",\"dateModified\":\"2023-01-06T05:37:01+00:00\",\"description\":\"42Gear's blog has everything you need to future-proof your business. Need to auto-play or loop your audio\/video files on Android?\",\"breadcrumb\":{\"@id\":\"https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/#breadcrumb\"},\"inLanguage\":\"de-DE\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.42gears.com\/de\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Auto-Play and Loop Audio and Video files in Android?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.42gears.com\/#website\",\"url\":\"https:\/\/www.42gears.com\/\",\"name\":\"42Gears Mobility Systems\",\"description\":\"Mobile Device Management (MDM), Mobile Security &amp; Mobile Device Lockdown\",\"publisher\":{\"@id\":\"https:\/\/www.42gears.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.42gears.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de-DE\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.42gears.com\/#organization\",\"name\":\"MDM - 42Gears\",\"url\":\"https:\/\/www.42gears.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de-DE\",\"@id\":\"https:\/\/www.42gears.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.42gears.com\/wp-content\/uploads\/2018\/12\/Featured-Image-42Gears-logo.png\",\"contentUrl\":\"https:\/\/www.42gears.com\/wp-content\/uploads\/2018\/12\/Featured-Image-42Gears-logo.png\",\"width\":499,\"height\":330,\"caption\":\"MDM - 42Gears\"},\"image\":{\"@id\":\"https:\/\/www.42gears.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/42gears\",\"https:\/\/x.com\/42Gears\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.42gears.com\/#\/schema\/person\/28a14f2c32de4a7903ac672579a88a2d\",\"name\":\"42Gears Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de-DE\",\"@id\":\"https:\/\/www.42gears.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7d257fb658a429b8607872336eac3833a8314ca3ca67d72c90ceeddc7700c42e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7d257fb658a429b8607872336eac3833a8314ca3ca67d72c90ceeddc7700c42e?s=96&d=mm&r=g\",\"caption\":\"42Gears Team\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Auto-Play and Loop Audio and Video files in Android? - 42Gears Mobility Systems","description":"42Gear's blog has everything you need to future-proof your business. Need to auto-play or loop your audio\/video files on Android?","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/","og_locale":"de_DE","og_type":"article","og_title":"How to Auto-Play and Loop Audio and Video files in Android?","og_description":"42Gear's blog has everything you need to future-proof your business. Need to auto-play or loop your audio\/video files on Android?","og_url":"https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/","og_site_name":"42Gears Mobility Systems","article_publisher":"https:\/\/www.facebook.com\/42gears","article_published_time":"2013-10-21T13:27:00+00:00","article_modified_time":"2023-01-06T05:37:01+00:00","author":"42Gears Team","twitter_card":"summary_large_image","twitter_creator":"@42Gears","twitter_site":"@42Gears","twitter_misc":{"Written by":"42Gears Team","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/#article","isPartOf":{"@id":"https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/"},"author":{"name":"42Gears Team","@id":"https:\/\/www.42gears.com\/#\/schema\/person\/28a14f2c32de4a7903ac672579a88a2d"},"headline":"How to Auto-Play and Loop Audio and Video files in Android?","datePublished":"2013-10-21T13:27:00+00:00","dateModified":"2023-01-06T05:37:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/"},"wordCount":242,"commentCount":2,"publisher":{"@id":"https:\/\/www.42gears.com\/#organization"},"keywords":["audio","automatic video looping","script","video"],"articleSection":["Android","Development","General","SureFox","Uncategorized"],"inLanguage":"de-DE","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/","url":"https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/","name":"How to Auto-Play and Loop Audio and Video files in Android? - 42Gears Mobility Systems","isPartOf":{"@id":"https:\/\/www.42gears.com\/#website"},"datePublished":"2013-10-21T13:27:00+00:00","dateModified":"2023-01-06T05:37:01+00:00","description":"42Gear's blog has everything you need to future-proof your business. Need to auto-play or loop your audio\/video files on Android?","breadcrumb":{"@id":"https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/#breadcrumb"},"inLanguage":"de-DE","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.42gears.com\/nl\/blog\/how-to-auto-play-and-loop-audio-and-video-files-in-android\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.42gears.com\/de\/"},{"@type":"ListItem","position":2,"name":"How to Auto-Play and Loop Audio and Video files in Android?"}]},{"@type":"WebSite","@id":"https:\/\/www.42gears.com\/#website","url":"https:\/\/www.42gears.com\/","name":"42Gears Mobility Systems","description":"Mobile Device Management (MDM), Mobile Security &amp; Mobile Device Lockdown","publisher":{"@id":"https:\/\/www.42gears.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.42gears.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de-DE"},{"@type":"Organization","@id":"https:\/\/www.42gears.com\/#organization","name":"MDM - 42Gears","url":"https:\/\/www.42gears.com\/","logo":{"@type":"ImageObject","inLanguage":"de-DE","@id":"https:\/\/www.42gears.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.42gears.com\/wp-content\/uploads\/2018\/12\/Featured-Image-42Gears-logo.png","contentUrl":"https:\/\/www.42gears.com\/wp-content\/uploads\/2018\/12\/Featured-Image-42Gears-logo.png","width":499,"height":330,"caption":"MDM - 42Gears"},"image":{"@id":"https:\/\/www.42gears.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/42gears","https:\/\/x.com\/42Gears"]},{"@type":"Person","@id":"https:\/\/www.42gears.com\/#\/schema\/person\/28a14f2c32de4a7903ac672579a88a2d","name":"42Gears Team","image":{"@type":"ImageObject","inLanguage":"de-DE","@id":"https:\/\/www.42gears.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7d257fb658a429b8607872336eac3833a8314ca3ca67d72c90ceeddc7700c42e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7d257fb658a429b8607872336eac3833a8314ca3ca67d72c90ceeddc7700c42e?s=96&d=mm&r=g","caption":"42Gears Team"}}]}},"author_meta":{"ID":"7","user_nicename":"42gears","user_email":"42gears@gmail.com","user_registered":"2015-07-15 04:55:37","display_name":"42Gears Team","first_name":"42Gears","last_name":"Team"},"_links":{"self":[{"href":"https:\/\/www.42gears.com\/de\/wp-json\/wp\/v2\/posts\/3475","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.42gears.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.42gears.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.42gears.com\/de\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.42gears.com\/de\/wp-json\/wp\/v2\/comments?post=3475"}],"version-history":[{"count":3,"href":"https:\/\/www.42gears.com\/de\/wp-json\/wp\/v2\/posts\/3475\/revisions"}],"predecessor-version":[{"id":85195,"href":"https:\/\/www.42gears.com\/de\/wp-json\/wp\/v2\/posts\/3475\/revisions\/85195"}],"wp:attachment":[{"href":"https:\/\/www.42gears.com\/de\/wp-json\/wp\/v2\/media?parent=3475"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.42gears.com\/de\/wp-json\/wp\/v2\/categories?post=3475"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.42gears.com\/de\/wp-json\/wp\/v2\/tags?post=3475"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}