You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/02/07 15:10:52 UTC

[GitHub] mattgrande closed pull request #37: Add seekCompleteCallback to seekTo.

mattgrande closed pull request #37: Add seekCompleteCallback to seekTo.
URL: https://github.com/apache/cordova-plugin-media/pull/37
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/doc/index.md b/doc/index.md
index d130e6e6..9f446f47 100644
--- a/doc/index.md
+++ b/doc/index.md
@@ -281,11 +281,12 @@ function for any `Media` resource that is no longer needed.
 
 Sets the current position within an audio file.
 
-    media.seekTo(milliseconds);
+    media.seekTo(milliseconds, seekCompleteCallback);
 
 ### Parameters
 
 - __milliseconds__: The position to set the playback position within the audio, in milliseconds.
+- __seekCompleteCallback__:  (Optional) The callback that executes after the `Media` object has completed the seek action. _(Function)_
 
 
 ### Quick Example
diff --git a/www/Media.js b/www/Media.js
index 083af362..13d51919 100644
--- a/www/Media.js
+++ b/www/Media.js
@@ -89,10 +89,13 @@ Media.prototype.stop = function() {
 /**
  * Seek or jump to a new time in the track..
  */
-Media.prototype.seekTo = function(milliseconds) {
+Media.prototype.seekTo = function(milliseconds, seekCompleteCallback) {
     var me = this;
     exec(function(p) {
         me._position = p;
+        if ( seekCompleteCallback ) {
+            seekCompleteCallback( me._position );
+        }
     }, this.errorCallback, "Media", "seekToAudio", [this.id, milliseconds]);
 };
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org