User avatar
Jo*
Posts: 8
Joined: Wed Jul 29, 2009 10:00 pm

How to stop video playing when hs box is closed

Hi there,

I checked the forum but couldn't find any topic covering my issue. If this or anything that is similar has been addressed before I'd appreciate if you could point me to the corresponding thread.

When I load a video in a hs box it plays fine. However, when I close the box, the audio of the video is still audible, which suggests, that the video is still running but due to the hs box being closed obviously isn't displayed anymore.

The same happens, when I open a website in a hs box that autoplays any audio tunes. Closing the hs box doesn't stop the audio tunes. Apparently the website is still loaded in the DOM.

How would I manage to stop either a video or a website playing audio to fully unload on the event of closing the hs box?

I've applied the video using an iframe objecttype (see my code below).

Thanks
Jo

Code: Select all

<div>
     <a class="highslide" href="video/S1030320.mp4" id="video" onclick="return hs.htmlExpand(this, { contentId: 'video1', objectType: 'iframe', objectWidth: 375, objectHeight: 300, objectLoadTime: 'after', allowWidthReduction: 0 } )" target="_blank">Play Video</a>
          <div class="highslide-html-content" id="video1" style="padding: 0pt; margin:0px 12px 0px -12px; width: 375px;">
               <div class="highslide-move html-header" style="border: 0pt none ;"></div>
                    <div class="highslide-body"></div>
                         <div style="border-top: 1px solid silver; padding: 5px 0pt; text-align: center;">
                              <img src="highslide3/graphics/resize.gif" class="highslide-resize" alt="Resize" title="Resize" style="width: 11px; height: 11px; 
                              float: right; position: relative; top: 4px; left:7px" />
                             <small>Video 1</small>
                        </div>
          </div>
</div>
User avatar
RoadRash
Posts: 8249
Joined: Tue Jul 15, 2008 6:43 pm
Location: Fredrikstad, Norway
Contact: Website

Re: How to stop video playing when hs box is closed

Set hs.preserveContent to false.
Add this between the head tags or in your highslide config file:

Code: Select all

hs.preserveContent = false;
Hilde
Highslide Support Team

Overview of my Highslide sample pages: RoadRash.no
User avatar
Jo*
Posts: 8
Joined: Wed Jul 29, 2009 10:00 pm

Re: How to stop video playing when hs box is closed

Sometimes things appear to be just so simple :wink:

Works like charm.

Thanks so much for your speedy reply! Very much appreciated!

Jo

Return to “Highslide JS Usage”