<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:clearspace="http://www.jivesoftware.com/xmlns/jive/rss" version="2.0">
  <channel>
    <title>Adobe Community: Message List - managing multiple audio with one toggle button</title>
    <link>https://forums.adobe.com/community/edge_animate?view=discussions</link>
    <description>Most recent forum messages</description>
    <language>en</language>
    <pubDate>Mon, 14 Jul 2014 03:14:16 GMT</pubDate>
    <generator>Jive Engage 7.0.0.1  (http://jivesoftware.com/products/)</generator>
    <dc:date>2014-07-14T03:14:16Z</dc:date>
    <dc:language>en</dc:language>
    <item>
      <title>Re: managing multiple audio with one toggle button</title>
      <link>https://forums.adobe.com/message/6547597?tstart=0#6547597</link>
      <description>&lt;!-- [DocumentBodyStart:54af8f97-1f18-4584-821e-081089ba37e6] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;Hi Marie,&lt;/p&gt;&lt;p&gt;This is a function that I use to stop all audio on the stage. You should be able to modify it to suit your need. What you have to watch-out for is that when you toggle (play) there is a chance for all the audio on the stage to play. Probably you will have to check the '&lt;a class="jive-link-external-small" href="http://www.w3schools.com/tags/av_prop_currenttime.asp" rel="nofollow"&gt;currentTime&lt;/a&gt;' property as well. Muting is not a solution as it will continue to play the sound silently.&lt;/p&gt;&lt;p&gt;function &lt;strong&gt;stopAllAudio()&lt;/strong&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp; $.each(sym.$("audio"), function(index, value) {&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(!$(this)[0].paused){&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(this)[0].pause();&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(this)[0].currentTime = 0;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; });&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="line-height: 1.5em; font-size: 10pt;"&gt;your solution would look something like this. You might require a global variable to record the playback status. Since you have multiple audios relying on its status may not be a good idea. You will have to &lt;/span&gt;tweak&lt;span style="line-height: 1.5em; font-size: 10pt;"&gt; this.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; line-height: 1.5em;"&gt;var isPaused = false; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;function &lt;strong&gt;toggleAllAudio()&lt;/strong&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; isPaused = !isPaused;&lt;/p&gt;&lt;p&gt;&amp;nbsp; $.each(sym.$("audio"), function(index, value) {&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(isPaused &amp;amp;&amp;amp; $(this)[0].paused){&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(this)[0].play();&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(this)[0].pause();&lt;/p&gt;&lt;p&gt;&amp;nbsp; });&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;reference: &lt;a class="jive-link-external-small" href="http://www.w3schools.com/tags/ref_av_dom.asp" rel="nofollow"&gt;HTML Audio/Video DOM Reference&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:54af8f97-1f18-4584-821e-081089ba37e6] --&gt;&lt;img src='/beacon?t=1415898931920' /&gt;</description>
      <pubDate>Mon, 14 Jul 2014 03:14:16 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/6547597?tstart=0#6547597</guid>
      <dc:date>2014-07-14T03:14:16Z</dc:date>
      <clearspace:dateToText>4 months 20 hours ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: managing multiple audio with one toggle button</title>
      <link>https://forums.adobe.com/message/6215387?tstart=0#6215387</link>
      <description>&lt;!-- [DocumentBodyStart:f0029b40-30bc-439f-aeef-8c4fe6490c41] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;Hey Marie, &lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I tried approaching this from a few different angles and unfortunately couldn't get it to work &lt;span aria-label="Sad" class="emoticon-inline emoticon_sad" style="height:16px;width:16px;"&gt;&lt;/span&gt; Bumping to the top in case anyone smarter than me has a solution...&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Sarah&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Edit: HA! HAHAHA! Take that Javascript. I think I found an answer...&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Try this:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;myAud=document.getElementsByTagName("audio");&lt;/p&gt;&lt;p&gt;for(var i=0; i&amp;lt;myAud.length; i++) &lt;/p&gt;&lt;p&gt;myAud[i].muted=true; &lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;This will get all of the documents audio elements and mute them - will setting up another button with muted=false work for the toggle?&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Sarah&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:f0029b40-30bc-439f-aeef-8c4fe6490c41] --&gt;</description>
      <pubDate>Mon, 17 Mar 2014 02:57:07 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/6215387?tstart=0#6215387</guid>
      <dc:date>2014-03-17T02:57:07Z</dc:date>
      <clearspace:dateToText>7 months 1 month ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>managing multiple audio with one toggle button</title>
      <link>https://forums.adobe.com/message/6203913?tstart=0#6203913</link>
      <description>&lt;!-- [DocumentBodyStart:587791be-a964-4d4f-89e3-f822037b0f98] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;My turn today to ask a question.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I have a complicated animation in which i have several sound FX that start at different points on the timeline. I would like to have a toggle button for all sound FX. I created an array and I can stop all the sounds without any problem but I am not sure how I would then toggle all the sounds back so they could become &lt;strong&gt;playable &lt;/strong&gt;again&amp;nbsp; but without playing since I do not want to play them all at the same time. &lt;/p&gt;&lt;p&gt;I though about using the mute toggle also but it seems that you cannot mute a sound that is not playing if that makes sense.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:587791be-a964-4d4f-89e3-f822037b0f98] --&gt;</description>
      <pubDate>Wed, 12 Mar 2014 19:42:24 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/6203913?tstart=0#6203913</guid>
      <dc:date>2014-03-12T19:42:24Z</dc:date>
      <clearspace:dateToText>8 months 2 days ago</clearspace:dateToText>
      <clearspace:replyCount>2</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
  </channel>
</rss>

