Advertisement
Guest User

Player_fanfic.js

a guest
Apr 27th, 2015
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function()
  2. {
  3.     $('.bgm').mediaelementplayer
  4.     ({
  5.         startVolume: 0.8,
  6.         loop: false,
  7.         features: ['playpause','volume'],
  8.         alwaysShowControls: true
  9.     });
  10.     $('.bgm').each(function()
  11.     {
  12.         var myBGM = this;
  13.         this.addEventListener('play', function()
  14.         {
  15.             $('.bgm').each(function()
  16.             {
  17.                 if (!(this === myBGM))
  18.                 {
  19.                     this.stop();
  20.                 }
  21.             });
  22.         });
  23.     });
  24.     $('.bgs').mediaelementplayer
  25.     ({
  26.         startVolume: 0.8,
  27.         loop: true,
  28.         features: ['playpause','volume'],
  29.         alwaysShowControls: true
  30.     });
  31.     $('.bgs').each(function()
  32.     {
  33.         var myBGS = this;
  34.         this.addEventListener('play', function()
  35.         {
  36.             $('.bgs').each(function()
  37.             {
  38.                 if (!(this === myBGS))
  39.                 {
  40.                     this.stop();
  41.                 }
  42.             });
  43.         });
  44.     });
  45. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement