Safari Problems

adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 3,115
edited December 2019 in News from the Dev Team

Problem 1: Sound in the HTML5 engine:

So we've recently been made aware (thanks @gingagaming) that HTML5 sound was not working right in Safari. Here's a quick explanation.

  • Safari has a new feature that require user interaction to trigger sounds before sound starts working on a page.
  • The way our game engines (and most non-custom game engines) work, sound is triggered as part of a game loop. Because of this, there's a little bit of indirection between a user click on a game and a sound triggering. This indirection is enough to not count as "user interaction to play a sound".
  • To solve this I've whipped up a bit of code to put an overlay on the game that will show if sound is disabled in the browser. I'll leave it up to you, the developer, to customize this more. I will place this code into the HTML5 package soon.
  • Place the code in the playerDelegate map in your index.html file, replacing the existing onLoadingBegin function.

Code here:

onLoadingBegin: function() {
  // Sound is suspended, let's unsuspend it.
  if (gs.AudioManager.current.context.state === 'suspended') {
    var div = document.createElement('div') = 'fixed' // Pin it relative to browser window and not game div. = '0' // Bottom = '0' // Left = '100vw' // Full viewport width = '10vh' // 10% viewport height = 'rgba(0,0,0,0.8)' // 0.8 alpha black = 'white' // White text = 'pointer' // Pointer cursor so they know they can click
    div.innerHTML = 'Sound disabled. Click here to enable sound...' // Prompt msg = 'sans-serif' // Font = '10vh' // Make text line height same as box height so it's vertically centered = '0 2em' // Add some padding to the left and right.
    div.onclick = function () {
      // When user clicks on the box, resume the audio manager and destroy the prompt box.
    // Add the prompt box to the window.

  engine.showOverlay(); = 'visible';

Publishing image uploads

Safari has changed how they handle certain server request and that breaks how we check image size for icon and loading image uploads in publishing. We should have a fix for that shortly.



  • adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 3,115

    Okay, more clarification on the uploading of images in safari. Basically safari doesn't let you programmatically submit the form anymore. Right now, we submit the form as soon as we verify the image is good. Since I'm pretty sure chrome has a similar restriction, we must be nesting the upload in too many callbacks to satisfy safari. To support this safari update we'll need to rewrite how we handle image uploads.

    For now, I would suggest you use firefox or chrome for your publishing needs until we address this.

Sign In or Register to comment.