Bug 1235301 - part 4 - webidl; r=ehsan
authorKaku Kuo <tkuo@mozilla.com>
Tue, 24 May 2016 23:05:59 +0800
changeset 340566 ad0f90c4b83a83abdc1ea29c6d3402b4f0551d5e
parent 340565 c70fa3dc42c07926cd94c8d66a52fcf431e1aac9
child 340567 8895926c8142c6387958ccf4ae741fb201836716
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1235301
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1235301 - part 4 - webidl; r=ehsan Please refere to the comment in the HTMLMediaElement.webidl file for details. MozReview-Commit-ID: C0a6wpGx6yD
dom/webidl/HTMLMediaElement.webidl
modules/libpref/init/all.js
--- a/dom/webidl/HTMLMediaElement.webidl
+++ b/dom/webidl/HTMLMediaElement.webidl
@@ -174,8 +174,45 @@ partial interface HTMLMediaElement {
 partial interface HTMLMediaElement {
   [Pref="media.useAudioChannelService.testing"]
   readonly attribute double computedVolume;
   [Pref="media.useAudioChannelService.testing"]
   readonly attribute boolean computedMuted;
   [Pref="media.useAudioChannelService.testing"]
   readonly attribute unsigned long computedSuspended;
 };
+
+/*
+ * HTMLMediaElement::seekToNextFrame() is a Mozilla experimental feature.
+ *
+ * The SeekToNextFrame() method provides a way to access a video element's video
+ * frames one by one without going through the realtime playback. So, it lets
+ * authors use "frame" as unit to access the video element's underlying data,
+ * instead of "time".
+ *
+ * The SeekToNextFrame() is a kind of seek operation, so normally, once it is
+ * invoked, a "seeking" event is dispatched. However, if the media source has no
+ * video data or is not seekable, the operation is ignored without filing the
+ * "seeking" event.
+ *
+ * Once the SeekToNextFrame() is done, a "seeked" event should always be filed
+ * and a "ended" event might also be filed depends on where the media element's
+ * position before seeking was. There are two cases:
+ * Assume the media source has n+1 video frames where n is a non-negative
+ * integers and the frame sequence is indexed from zero.
+ * (1) If the currentTime is at anywhere smaller than the n-th frame's beginning
+ *     time, say the currentTime is now pointing to a position which is smaller
+ *     than the x-th frame's beginning time and larger or equal to the (x-1)-th
+ *     frame's beginning time, where x belongs to [1, n], then the
+ *     SeekToNextFrame() operation seeks the media to the x-th frame, sets the
+ *     media's currentTime to the x-th frame's beginning time and dispatches a
+ *     "seeked" event.
+ * (2) Otherwise, if the currentTime is larger or equal to the n-th frame's
+ *     beginning time, then the SeekToNextFrame() operation sets the media's
+ *     currentTime to the duration of the media source and dispatches a "seeked"
+ *     event and an "ended" event.
+ */
+partial interface HTMLMediaElement {
+  [Throws, Pref="media.seekToNextFrame.enabled"]
+  void seekToNextFrame(); // This API should be an asynchronous one which
+                          // returns a Promise<void>. Bug 1276272 follows this
+                          // issue.
+};
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -5388,8 +5388,16 @@ pref("dom.mozBrowserFramesEnabled", fals
 pref("layout.css.color-adjust.enabled", true);
 
 // Disable Node.rootNode in release builds.
 #ifdef RELEASE_BUILD
 pref("dom.node.rootNode.enabled", false);
 #else
 pref("dom.node.rootNode.enabled", true);
 #endif
+
+// Once bug 1276272 is resolved, we will trun this preference to default ON in
+// non-release channels.
+#ifdef RELEASE_BUILD
+pref("media.seekToNextFrame.enabled", false);
+#else
+pref("media.seekToNextFrame.enabled", false);
+#endif