5 Replies Latest reply on Jan 22, 2015 10:10 AM by steve_ssh

    Audio starting automatically in Web View

    tomplant

      Hey there,

      I'm putting a link to podcast episodes in a database - then allowing access to those episodes through webview - but when the use goes to the record, the audio automatically starts. I'd rather people could choose to start the audio rather than having it start automatically. As a fallback, I can put this in a button, but if there's some way to show the audio file without starting it, that would be preferable.

       

      Any ideas?

       

      Thanks,

      Tom

        • 1. Re: Audio starting automatically in Web View
          mtwalker

          If podcast starts playing automatically when you paste the podcast link into a browser address, it will do the same in the web viewer.

           

          How about a slide control? The first panel could have a graphic for the podcast. It could be a logo, a big "play" button or even a screen grab of the audio player. When the user clicks that it goes to the second panel that has the actual web viewer.

          • 2. Re: Audio starting automatically in Web View
            steve_ssh

            Hi Tom,

             

            Just as an FYI:

             

            In FMGo the audio may not auto-start, due to the rules about how iOS handles media playback in the web-kit.

             

            Thus, if you are deploying across both mobile and desktop platforms, you may need to branch your implementation differently based on the device.

             

            HTH,

             

            - steve

            • 3. Re: Audio starting automatically in Web View
              tomplant

              Hey Todd - thanks for this suggestion. I'll play around with it - may be easier to just have a button. I think the problem may be that I'm linking directly to the mp3 file in the podcast as opposed to the page - but I just wanted a small weblink window - not the whole webpage for the podcast...

              • 4. Re: Audio starting automatically in Web View
                tomplant

                Hey Steve - good heads up on the IOS side. I'll check on it.

                 

                Thanks,

                Tom

                • 5. Re: Audio starting automatically in Web View
                  steve_ssh

                  tomplant wrote:


                  I think the problem may be that I'm linking directly to the mp3 file in the podcast as opposed to the page - but I just wanted a small weblink window - not the whole webpage for the podcast...

                   

                  Hi Tom,

                   

                  Instead of linking directly to the mp3 file, you might try using just a small bit of HTML to present the audio to the user.

                   

                  I believe that this will afford you the ability to just have a small player show up that the user can control. Moreover, it can be configured to not auto-play.

                   

                  On OSX/iOS this should be easy, as you can use the HTML5 audio tag.

                   

                  On Windows, I'm going to take a guess that you accomplish what you need using the embed tag, which I hope will be properly handled by the Windows FMP WebViewer, which, I am told, behaves as IE8.

                   

                  Below I'll put an FM calc that you could play with to see if you can get it to work out.  It returns a value that can be used to set the WebViewer URL.   All that it is doing is returning a small chunk of HTML to present the audio content in either an audio tag, or an embed tag, depending on the browser.

                   

                  I have not tested it on Windows FMP.  I have tested the HTML in IE8, though -- so I think it has some promise.

                   

                  HTH & Best,

                   

                  -steve

                   

                  /*============== BEGIN CALCULATION ===============*/

                   

                  Let([

                   

                    varAudioURL = "URL_TO_AUDIO_FILE_GOES_HERE";

                   

                    varHTML =

                   

                  "<html>

                  <body style='margin: 0px; padding: 0px;'>

                  <audio id='audio_osx' src='{{AUDIO_URL}}' preload='auto' controls></audio>

                  <!--[if lt IE 9]>

                  <embed src='{{AUDIO_URL}}' volume='100' height='50' width='400' autostart='false' loop='1'/>

                  <![endif]-->

                  </body>

                  </html>"


                  ];

                   

                    Case(

                      IsEmpty( varAudioURL ); "";

                      "data:text/html," & Substitute( varHTML; "{{AUDIO_URL}}"; varAudioURL )

                    )

                  )