Skip to content

Autoplay #32

@Bang1338

Description

@Bang1338

Hi, I have a problem with autoplaying in my site...

  • Everytime I XMPlayer.init(); and fetch, I have to wait about 2 to 3 minutes before playing...
  • Here's how I did it...
     <script>
     // Play the XM file
      function play() {
        XMPlayer.play();
      }
	
      // Initialize the player
      XMPlayer.init();

      // Load the XM file
      fetch('a sad touch.xm')
        .then(response => response.arrayBuffer())
        .then(buffer => {
			XMPlayer.load(buffer);
			setTimeout(function(){
				play();
			}, 3500);
		});

      // Pause the XM file
      function pause() {
        XMPlayer.pause();
      }

      // Stop the XM file
      function stop() {
        XMPlayer.stop();
      }
    </script>
  • Is jsxm support autoplay after loaded xm? or I just live in pain?

Site: bang1338.xyz

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions