diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-11-23 17:47:18 -0800 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-11-23 17:47:18 -0800 |
commit | 8c5203f7e1c3a12113c6f2c6d45ae7e1dd780e75 (patch) | |
tree | 452ac102680dff208ffe41e1cb59d88fa514245a /view/js | |
parent | dfaf1a1075acdeccea5c730611c13db3d61d6277 (diff) | |
download | volse-hubzilla-8c5203f7e1c3a12113c6f2c6d45ae7e1dd780e75.tar.gz volse-hubzilla-8c5203f7e1c3a12113c6f2c6d45ae7e1dd780e75.tar.bz2 volse-hubzilla-8c5203f7e1c3a12113c6f2c6d45ae7e1dd780e75.zip |
issue #185 - prevent liveUpdate from updating while the built-in html5 media player is "active". This will not have any affect on flash or other media players, and could potentially get confused if you have more than one media player actively playing at any given time.
Diffstat (limited to 'view/js')
-rw-r--r-- | view/js/main.js | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/view/js/main.js b/view/js/main.js index 8bd4357cc..ca7d50b90 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -247,6 +247,7 @@ var pageHasMoreContent = true; var updateCountsOnly = false; var divmore_height = 400; var last_filestorage_id = null; +var mediaPlaying = false; $(function() { $.ajaxSetup({cache: false}); @@ -359,7 +360,7 @@ function NavUpdate() { if(liking) $('.like-rotator').spin(false); - if(! stopped) { + if((! stopped) && (! mediaPlaying)) { var pingCmd = 'ping' + ((localUser != 0) ? '?f=&uid=' + localUser : ''); $.get(pingCmd,function(data) { @@ -595,6 +596,24 @@ function updateConvItems(mode,data) { $('body').css('cursor', 'auto'); } + $('video').off('playing'); + $('video').off('pause'); + $('audio').off('playing'); + $('audio').off('pause'); + + $('video').on('playing', function() { + mediaPlaying = true; + }); + $('video').on('pause', function() { + mediaPlaying = false; + }); + $('audio').on('playing', function() { + mediaPlaying = true; + }); + $('audio').on('pause', function() { + mediaPlaying = false; + }); + /* autocomplete @nicknames */ $(".comment-edit-form textarea").editor_autocomplete(baseurl+"/acl?f=&n=1"); |