Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
play_an_mp3_audio_stream_in_phonegap [2013/07/26 21:29]
Joel Dare
play_an_mp3_audio_stream_in_phonegap [2015/09/16 18:49]
Joel Dare
Line 46: Line 46:
  
 **Note:** Some users have have had trouble finding the //Sound.m// file.  It's not in the XCode project itself. ​ You'll find it beneath your home directory (~) under //​~/​PhoneGapLib/​Classes///​ or you can just use Finder to search for //​Sound.m//​. ​ Right-click on it and open it in XCode. **Note:** Some users have have had trouble finding the //Sound.m// file.  It's not in the XCode project itself. ​ You'll find it beneath your home directory (~) under //​~/​PhoneGapLib/​Classes///​ or you can just use Finder to search for //​Sound.m//​. ​ Right-click on it and open it in XCode.
 +
 +====== Other Pause Alternatives ======
 +
 +If the pause() command above doesn'​t work for you, these two lines might work to pause the audio.
 +
 +    myaudio.pause(); ​
 +    myaudio.currentTime ​ = 0;
 +
 +If that doesn’t work, another popular suggestion is to set the src to nothing on “pause” and then back to the correct source on play again.
 +
 +    myaudio.src = "";​
  
 ====== Working HTML Example ====== ====== Working HTML Example ======
Line 56: Line 67:
  
 <​html>​ <​html>​
-<script type="text/javascript"​>document.write(unescape("%3Cscript src='http" ​+  (document.location.protocol ​== 'https:' ? '​s'​ : ''​) + "://www.coffeecup.com/api/sdrive/​forms/​form.js?name=phonegap%26slug=171222%26width=552%26height=467' ​type='text/javascript'​%3E%3C/​script%3E"));</script>+<style> 
 +.csv_subscription { 
 +    font-family:​ Helvetica, Arial, sans-serif;​ 
 +    font-size: 14px; 
 +    background-color:​ #E2E2E2; 
 +    width: 250px; 
 +    padding: 20px; 
 +    margin: auto; 
 +
 +.csv_subscription a { 
 +    ​text-decoration:​ none; 
 +    display: inline-block;​ 
 +    font-weight:​ normal; 
 +    background-color:​ #5BA0D0; 
 +    color: white !important;​ 
 +
 +.csv_subscription p { 
 +    margin: 0 0 20px 0; 
 +
 +.csv_subscription .headline { 
 +    font-weight:​ bold; 
 +    font-size: 1.25em; 
 +    text-align: center; 
 +
 +.csv_subscription .call_container { 
 +    text-align: center; 
 +
 +.csv_subscription .call_to_act { 
 +    margin-bottom:​ 5px; 
 +    padding: 10px; 
 +    background-color:​ #​.csv_subscription { 
 +    font-family:​ Helvetica, Arial, sans-serif;​ 
 +    background-color:​ #FFBC66; 
 +    width: 400px; 
 +    padding: 20px; 
 +    margin: auto; 
 +
 +.csv_subscription a { 
 +    text-decoration:​ none; 
 +    display: inline-block;​ 
 +    font-weight:​ normal; 
 +
 +.csv_subscription p { 
 +    margin: 0 0 20px 0; 
 +
 +.csv_subscription .headline { 
 +    font-weight:​ bold; 
 +    font-size: 1.25em; 
 +    text-align: center; 
 +
 +.csv_subscription .call_container { 
 +    text-align: center; 
 +
 +.csv_subscription .call_to_act { 
 +    margin-bottom:​ 5px; 
 +    padding: 10px; 
 +    background-color:​ #5BA0D0; 
 +    color: white; 
 +    font-weight:​ bold; 
 +
 +.csv_subscription .call_label { 
 +    font-size: 0.75em; 
 +
 +.csv_subscription .hurry { 
 +    text-align: center; 
 +    font-size: 0.75em; 
 +    margin-bottom:​ 0px; 
 +
 +    color: white !important;​ 
 +    font-weight:​ bold; 
 +
 +.csv_subscription .call_label { 
 +    font-size: 0.75em; 
 +
 +.csv_subscription .hurry { 
 +    text-align: center; 
 +    font-size: 0.75em; 
 +    margin-bottom:​ 0px; 
 +
 +</style> 
 +<div class="csv_subscription">​ 
 +    <p class="headline">​For $9.95 Get Answers to Your PhoneGap Questions</​p>​ 
 +    <​p>​Send me an email and explain the problemI'll send back my step by step instructions.</​p>​ 
 +    <div class="​call_container">​ 
 +        <a class="​call_to_act"​ href="https://​www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&​hosted_button_id=9EM5E2CNEFYJG">​Subscribe</​a>​ 
 +        <p class="​call_label">​Only $9.95</​p>​ 
 +    </​div>​ 
 +    <​p>​After,​ I'll be on retainer to answer your other questions. If you don't need any more help, cancel anytime.<​/p> 
 +    <p class="hurry">​Please hurry, only 2 slots are available.</​p>​ 
 +</div>
 </​html>​ </​html>​
 ====== Contributors ====== ====== Contributors ======
  
 Many thanks to the people who write to me and ask questions about this.  I don't work with PhoneGap that often but the questions help me refine these instructions and make them more clear. ​ That helps even more developers. ​ You know who you are. Many thanks to the people who write to me and ask questions about this.  I don't work with PhoneGap that often but the questions help me refine these instructions and make them more clear. ​ That helps even more developers. ​ You know who you are.
comments powered by Disqus
play_an_mp3_audio_stream_in_phonegap.txt · Last modified: 2020/06/01 22:53 (external edit)