<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>14309</bug_id>
          
          <creation_ts>2011-09-27 17:09:30 +0000</creation_ts>
          <short_desc>&lt;track&gt; Constructor for &apos;TextTrackCue&apos; is not defined</short_desc>
          <delta_ts>2012-07-18 18:39:53 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>K</status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Frank Olivier">franko</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>eric.carlson</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>philipj</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>silviapfeiffer1</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>57422</commentid>
    <comment_count>0</comment_count>
    <who name="Frank Olivier">franko</who>
    <bug_when>2011-09-27 17:09:30 +0000</bug_when>
    <thetext>Spec text:

In this example, an audio element is used to play a specific sound-effect from a sound file containing many sound effects. A cue is used to pause the audio, so that it ends exactly at the end of the clip, even if the browser is busy running some script. If the page had relied on script to pause the audio, then the start of the next clip might be heard if the browser was not able to run the script at the exact time specified.
var sfx = new Audio(&apos;sfx.wav&apos;);
var sounds = a.addTextTrack(&apos;metadata&apos;);

// add sounds we care about
sounds.addCue(new TextTrackCue(&apos;dog bark&apos;, 12.783, 13.612, &apos;&apos;, &apos;&apos;, &apos;&apos;, true));
sounds.addCue(new TextTrackCue(&apos;kitten mew&apos;, 13.612, 15.091, &apos;&apos;, &apos;&apos;, &apos;&apos;, true));

function playSound(id) {
  sfx.currentTime = sounds.getCueById(id).startTime;
  sfx.play();
}

sfx.oncanplaythrough = function () {
  playSound(&apos;dog bark&apos;);
}
window.onbeforeunload = function () {
  playSound(&apos;kitten mew&apos;);
  return &apos;Are you sure you want to leave this awesome page?&apos;;
}

------------------------------------------------------------------------------
Issue description:

This example refers to a constructor, &quot;new TextTrackCue&quot; that is not defined anywhere in the spec.  In fact, the spec does not provide any way to create an instance of TextTrackCue without using a track element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57645</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-02 16:44:35 +0000</bug_when>
    <thetext>I&apos;ll add the constructor as part of taking all this out into the WebVTT CG.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58266</commentid>
    <comment_count>2</comment_count>
    <who name="Silvia Pfeiffer">silviapfeiffer1</who>
    <bug_when>2011-10-15 00:27:51 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; I&apos;ll add the constructor as part of taking all this out into the WebVTT CG.

Well, the HTML side of things wouldn&apos;t go into a WebVTT spec, right? So, the constructor still needs to go in there...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59139</commentid>
    <comment_count>3</comment_count>
    <who name="Frank Olivier">franko</who>
    <bug_when>2011-10-28 18:54:04 +0000</bug_when>
    <thetext>As Sylvia points out, we need a constructor in the html spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59147</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-28 19:50:13 +0000</bug_when>
    <thetext>And you have one now. That&apos;s why I marked the bug fixed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>