Playing sound from YouTube but hiding the video

Hi,
I am trying to use other ways to play sounds rather than attaching mp3, ogg files etc that make for a really large file size and loading time.

I tried to follow this - https://docs.textadventures.co.uk/quest/adding_videos.html
to test having a video's sound playing in the background (without showing the video)
but something is not working...

Here is my initial code:

<!--Saved by Quest 5.8.6836.13983-->
<asl version="580">
  <include ref="English.aslx" />
  <include ref="Core.aslx" />
  <game name="An Heirloom">
    <gameid>f2a1bc00-32bd-4586-9f3c-dec7435def82</gameid>
    <version>1.0</version>
    <firstpublished>2019</firstpublished>
    <defaultwebfont>VT323</defaultwebfont>
    <backgroundimage>Webp.net-gifmaker.gif</backgroundimage>
    <setbackgroundopacity />
    <backgroundopacity type="double">0.9</backgroundopacity>
    <showpanes type="boolean">false</showpanes>
    <showlocation type="boolean">false</showlocation>
    <showborder type="boolean">false</showborder>
    <defaultbackground>Black</defaultbackground>
    <defaultforeground>White</defaultforeground>
    <showcommandbar type="boolean">false</showcommandbar>
    <defaultfont>'Courier New', Courier, monospace</defaultfont>
    <defaultfontsize type="int">20</defaultfontsize>
    <defaultlinkforeground>PaleTurquoise</defaultlinkforeground>
    <showdescriptiononenter />
    <autodescription />
    <attr name="autodescription_youcansee" type="int">0</attr>
    <attr name="autodescription_youcango" type="int">0</attr>
    <attr name="autodescription_youarein" type="int">0</attr>
    <attr name="autodescription_description" type="int">1</attr>
  </game>
  <object name="room">
    <inherit name="editor_room" />
    <description type="script"><![CDATA[
      TextFX_Unscramble ("An Heirloom<br/>Memory Retrieval Software 3.1<br/><br/>", 100, 1)
      ShowYouTube ("VQ9LxaYDjyc")
      JS.JS.uiHide ("#my-video")
    ]]></description>
    <object name="player">
      <inherit name="editor_object" />
      <inherit name="editor_player" />
    </object>
  </object>
  <turnscript>
    <script>
    </script>
  </turnscript>
  <function name="SetLastIframeID">
    // Find all the iframes
    js = "var iframes = document.getElementsByTagName('iframe');"
    // Find the last iframe, and call it "lastIframe"
    js = js + "var lastIframe = iframes[iframes.length-1];"
    js = js + "lastIframe.id = '"+id+"'"
    JS.eval (js)
    JS.eval ("$('#my-video').width('10%');")
    SetLastIframeID ("my-video")
  </function>
</asl>

JS.JS.uiHide ("#my-video") looks strange


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums