How to make iframe to repeat mp3 inside you?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
7 views
Good day!

There is code:



Which attribute is needed here to keep the song spinning in a circle?

Thank you!
by | 7 views

2 Answers

0 like 0 dislike
He needs to play an audio file automatically, but many browsers now prevent this. So it uses an iframe, but it has no attribute for looping.!
Of course I'm a little late, but I solved this problem so:

\rvar EngWorksPlayer=document.getElementById('EngWorksPlayer'),EngWorksPlayerLinks='ссылка';\rwindow.onload=(function(){\rEngWorksPlayer.innerHTML='';\r});\r


if suddenly all the same it will be necessary ifrim, it can be something like this:


\rvar IFR=document.getElementById('IFR'),audio=new Audio();audio.src="ссылка на аудио";//создаем объект audio и указываем путь к треку\raudio.addEventListener('loadedmetadata',function(){//обработчик для получения метаинфы о треке\rvar timerId=setInterval(function(){\rIFR.setAttribute("src","ссылка на аудио");\r},audio.duration*1000+444);//получив длину аудифайла переводим в милисеки добавляем к ней немного и с этим промежутком делаем замену атрибута на тот же самый тем самым файл будет крутиться по кругу\r});\r

but there is a flaw... the Explorer does not play ifrim, he sees it as a document. In this case, you can combine the options, after checking the user's browser via php:
$user_agent=$_SERVER['HTTP_USER_AGENT'];//get browser information if(stristr($user_agent,'Trident/')){// if IE, ie is the coincidence of the text "Trident/" then: echo '', '',\r'window.onload=(function(){',\r'document.getElementById("AuDio").play();',\r'});',\r'';\r}else{// в остальных случаях\recho\t'', 'var IFR=document.getElementById(\\'IFR\\'),audio=new Audio();audio.src="ссылка";',\r'audio.addEventListener(\\'loadedmetadata\\',function(){',\r'setInterval(function(){',\r'IFR.setAttribute("src","ссылка");',\r'},audio.duration*1000+444);',\r'});',\r'';\r}
by
0 like 0 dislike
why iframe if now all supported audio
by

Related questions

110,608 questions
257,186 answers
0 comments
28,031 users