[TASK] Move video-js to contrib 51/21451/3
authorFelix Kopp <felix-source@phorax.com>
Sat, 15 Jun 2013 13:11:58 +0000 (15:11 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 16 Jun 2013 21:31:31 +0000 (23:31 +0200)
To resolve /t3lib few more files should be moved:
Moves video-js styles controls to contrib.

Change-Id: I648d3bdd17ed0414e6ef1041f3630c343c73747d
Resolves: #49152
Releases: 6.2
Reviewed-on: https://review.typo3.org/21451
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
13 files changed:
t3lib/js/videojs/audio-description.js [deleted file]
t3lib/js/videojs/audio-description.png [deleted file]
t3lib/js/videojs/captions.js [deleted file]
t3lib/js/videojs/captions.png [deleted file]
t3lib/js/videojs/control-bar.css [deleted file]
t3lib/js/videojs/control-bar.js [deleted file]
typo3/contrib/videojs/video-js/controls/audio-description.js [new file with mode: 0644]
typo3/contrib/videojs/video-js/controls/audio-description.png [new file with mode: 0644]
typo3/contrib/videojs/video-js/controls/captions.js [new file with mode: 0644]
typo3/contrib/videojs/video-js/controls/captions.png [new file with mode: 0644]
typo3/contrib/videojs/video-js/controls/control-bar.css [new file with mode: 0644]
typo3/contrib/videojs/video-js/controls/control-bar.js [new file with mode: 0644]
typo3/sysext/frontend/Classes/ContentObject/FlowPlayerContentObject.php

diff --git a/t3lib/js/videojs/audio-description.js b/t3lib/js/videojs/audio-description.js
deleted file mode 100644 (file)
index 168c2ab..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2011 Stanislas Rolland <typo3@sjbr.ca>
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *  A copy is found in the textfile GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-/* Audio description Toggle Behaviors for videoJS */
-VideoJS.player.newBehavior("audioDescriptionToggle", function(element) {
-               _V_.addListener(element, "click", this.onAudioDescriptionToggleClick.context(this));
-       },{
-                       // When the user clicks on the audioDescription button, update audioDescription state
-               onAudioDescriptionToggleClick: function(event) {
-                       if (this.audioDescriptionEnabled) {
-                               this.disableAudioDescription();
-                       } else {
-                               this.enableAudioDescription();
-                       }
-               }
-       }
-);
-VideoJS.player.extend({
-               // Audio description state variable
-       audioDescriptionEnabled: false,
-               // Reference to the audio description audio element
-       audioDescription: null,
-               // Enable audio description
-       enableAudioDescription: function (event) {
-                       // Set reference if not yet done
-               if (!this.audioDescription) {
-                       var id = this.video.id.replace("video_js", "audio_element");
-                       this.audioDescription = document.getElementById(id);
-               }
-               if (this.audioDescription && this.audioDescription.nodeName == 'AUDIO') {
-                       this.audioDescription.muted = false;
-                       this.audioDescriptionEnabled = true;
-               }
-       },
-               // Disable audio description
-       disableAudioDescription: function (event) {
-               if (this.audioDescription && this.audioDescription.nodeName == 'AUDIO') {
-                       this.audioDescription.muted = true;
-                       this.audioDescriptionEnabled = false;
-               }
-       }
-});
\ No newline at end of file
diff --git a/t3lib/js/videojs/audio-description.png b/t3lib/js/videojs/audio-description.png
deleted file mode 100644 (file)
index 2150c5d..0000000
Binary files a/t3lib/js/videojs/audio-description.png and /dev/null differ
diff --git a/t3lib/js/videojs/captions.js b/t3lib/js/videojs/captions.js
deleted file mode 100644 (file)
index 38e35c4..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2011 Stanislas Rolland <typo3@sjbr.ca>
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *  A copy is found in the textfile GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-/* Captions Toggle Behaviors for videoJS */
-VideoJS.player.newBehavior("captionsToggle",
-       function(element) {
-               _V_.addListener(element, "click", this.onCaptionsToggleClick.context(this));
-       },{
-               // When the user clicks on the subtitles button, update subtitles setting
-       onCaptionsToggleClick: function(event) {
-                       if (this.subtitlesDisplay.style.visibility != "hidden") {
-                               this.hideCaptions();
-                       } else {
-                               this.showCaptions();
-                       }
-               }
-       }
-);
-VideoJS.player.extend({
-               // Override to use captions kind of track rather than subtitles
-       getSubtitles: function(){
-               var tracks = this.video.getElementsByTagName("TRACK");
-               for (var i=0,j=tracks.length; i<j; i++) {
-                       if (tracks[i].getAttribute("kind") == "captions" && tracks[i].getAttribute("src")) {
-                               this.subtitlesSource = tracks[i].getAttribute("src");
-                               this.loadSubtitles();
-                               this.buildSubtitles();
-                       }
-               }
-       },
-       showCaptions: function (event) {
-               this.subtitlesDisplay.style.visibility = "visible";
-       },
-       hideCaptions: function (event) {
-               this.subtitlesDisplay.style.visibility = "hidden";
-       }       
-});
\ No newline at end of file
diff --git a/t3lib/js/videojs/captions.png b/t3lib/js/videojs/captions.png
deleted file mode 100644 (file)
index 33a56b1..0000000
Binary files a/t3lib/js/videojs/captions.png and /dev/null differ
diff --git a/t3lib/js/videojs/control-bar.css b/t3lib/js/videojs/control-bar.css
deleted file mode 100644 (file)
index abfc66a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Placement of Control Items 
-   - Left side of pogress bar, use left & width
-   - Rigth side of progress bar, use right & width
-   - Expand with the video (like progress bar) use left & right */
-.vjs-controls > div.vjs-play-control       { left: 5px;   width: 25px;  }
-.vjs-controls > div.vjs-progress-control   { left: 35px;  right: 221px; } /* Using left & right so it expands with the width of the video */
-.vjs-controls > div.vjs-time-control       { width: 75px; right: 156px;  } /* Time control and progress bar are combined to look like one */
-.vjs-controls > div.vjs-volume-control     { width: 50px; right: 101px;  }
-.vjs-controls > div.vjs-captions-control  { width: 31px; right: 65px;   }
-.vjs-controls > div.vjs-audio-description-control  { width: 25px; right: 35px;   }
-.vjs-controls > div.vjs-fullscreen-control { width: 25px; right: 5px;   }
-       /* Sub titles toggle*/
-.vjs-captions-control div { cursor: pointer !important; }
-.vjs-captions-control div {
-  padding: 0; text-align: left; vertical-align: top; cursor: pointer !important; 
-  margin: 5px 0 0 5px; /* Placement within the fullscreen control item */
-  width: 20px; height: 20px;
-}
-.vjs-captions-control div { background-image: url("captions.png"); background-repeat:no-repeat; background-position: center center;}
-       /* Audio description toggle*/
-.vjs-audio-description-control div { cursor: pointer !important; }
-.vjs-audio-description-control div {
-  padding: 0; text-align: left; vertical-align: top; cursor: pointer !important; 
-  margin: 5px 0 0 5px; /* Placement within the fullscreen control item */
-  width: 20px; height: 20px;
-}
-.vjs-audio-description-control div { background-image: url("audio-description.png"); background-repeat:no-repeat; }
\ No newline at end of file
diff --git a/t3lib/js/videojs/control-bar.js b/t3lib/js/videojs/control-bar.js
deleted file mode 100644 (file)
index 5cfc410..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2011 Stanislas Rolland <typo3@sjbr.ca>
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *  A copy is found in the textfile GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-/* Extended control bar for videoJS */
-VideoJS.player.extend({
-  /* Control Bar override to add the subtitles control
-  ================================================================================ */
-  buildAndActivateControlBar: function(){
-    /* Creating this HTML
-      <div class="vjs-controls">
-        <div class="vjs-play-control">
-          <span></span>
-        </div>
-        <div class="vjs-progress-control">
-          <div class="vjs-progress-holder">
-            <div class="vjs-load-progress"></div>
-            <div class="vjs-play-progress"></div>
-          </div>
-        </div>
-        <div class="vjs-time-control">
-          <span class="vjs-current-time-display">00:00</span><span> / </span><span class="vjs-duration-display">00:00</span>
-        </div>
-        <div class="vjs-volume-control">
-          <div>
-            <span></span><span></span><span></span><span></span><span></span><span></span>
-          </div>
-        </div>
-        <div class="vjs-subtitles-control">
-          <div>
-            <span></span><span></span><span></span><span></span>
-          </div>
-        </div>
-        <div class="vjs-audio-description-control">
-          <div>
-            <span></span><span></span><span></span><span></span>
-          </div>
-        </div>
-        <div class="vjs-fullscreen-control">
-          <div>
-            <span></span><span></span><span></span><span></span>
-          </div>
-        </div>
-      </div>
-    */
-
-    // Create a div to hold the different controls
-    this.controls = _V_.createElement("div", { className: "vjs-controls" });
-    // Add the controls to the video's container
-    this.box.appendChild(this.controls);
-    this.activateElement(this.controls, "controlBar");
-    this.activateElement(this.controls, "mouseOverVideoReporter");
-
-    // Build the play control
-    this.playControl = _V_.createElement("div", { className: "vjs-play-control", innerHTML: "<span></span>" });
-    this.controls.appendChild(this.playControl);
-    this.activateElement(this.playControl, "playToggle");
-
-    // Build the progress control
-    this.progressControl = _V_.createElement("div", { className: "vjs-progress-control" });
-    this.controls.appendChild(this.progressControl);
-
-    // Create a holder for the progress bars
-    this.progressHolder = _V_.createElement("div", { className: "vjs-progress-holder" });
-    this.progressControl.appendChild(this.progressHolder);
-    this.activateElement(this.progressHolder, "currentTimeScrubber");
-
-    // Create the loading progress display
-    this.loadProgressBar = _V_.createElement("div", { className: "vjs-load-progress" });
-    this.progressHolder.appendChild(this.loadProgressBar);
-    this.activateElement(this.loadProgressBar, "loadProgressBar");
-
-    // Create the playing progress display
-    this.playProgressBar = _V_.createElement("div", { className: "vjs-play-progress" });
-    this.progressHolder.appendChild(this.playProgressBar);
-    this.activateElement(this.playProgressBar, "playProgressBar");
-
-    // Create the progress time display (00:00 / 00:00)
-    this.timeControl = _V_.createElement("div", { className: "vjs-time-control" });
-    this.controls.appendChild(this.timeControl);
-
-    // Create the current play time display
-    this.currentTimeDisplay = _V_.createElement("span", { className: "vjs-current-time-display", innerHTML: "00:00" });
-    this.timeControl.appendChild(this.currentTimeDisplay);
-    this.activateElement(this.currentTimeDisplay, "currentTimeDisplay");
-
-    // Add time separator
-    this.timeSeparator = _V_.createElement("span", { innerHTML: " / " });
-    this.timeControl.appendChild(this.timeSeparator);
-
-    // Create the total duration display
-    this.durationDisplay = _V_.createElement("span", { className: "vjs-duration-display", innerHTML: "00:00" });
-    this.timeControl.appendChild(this.durationDisplay);
-    this.activateElement(this.durationDisplay, "durationDisplay");
-
-    // Create the volume control
-    this.volumeControl = _V_.createElement("div", {
-      className: "vjs-volume-control",
-      innerHTML: "<div><span></span><span></span><span></span><span></span><span></span><span></span></div>"
-    });
-    this.controls.appendChild(this.volumeControl);
-    this.activateElement(this.volumeControl, "volumeScrubber");
-
-    this.volumeDisplay = this.volumeControl.children[0];
-    this.activateElement(this.volumeDisplay, "volumeDisplay");
-
-    // Create the captions control
-    this.captionsControl = _V_.createElement("div", {
-      className: "vjs-captions-control",
-      innerHTML: "<div><span></span><span></span><span></span><span></span></div>"
-    });
-    this.controls.appendChild(this.captionsControl);
-       // Hide the control if there are no tracks
-    var tracks = this.video.getElementsByTagName("TRACK");
-    if (tracks.length) {
-         this.activateElement(this.captionsControl, "captionsToggle");
-    } else {
-         this.captionsControl.style.display = "none";
-    }
-
-    // Create the audio description control
-    this.audioDescriptionControl = _V_.createElement("div", {
-      className: "vjs-audio-description-control",
-      innerHTML: "<div><span></span><span></span><span></span><span></span></div>"
-    });
-       // Look for the audio description associated with this video element
-       // We could look for audio with same mediagroup...
-    var id = this.video.id.replace("video_js", "audio_element");
-    var audioDescription = document.getElementById(id);
-    if (!!audioDescription) {
-           this.controls.appendChild(this.audioDescriptionControl);
-           this.activateElement(this.audioDescriptionControl, "audioDescriptionToggle");
-    } else {
-           this.audioDescriptionControl.style.display = "none";
-    }
-
-    // Crete the fullscreen control
-    this.fullscreenControl = _V_.createElement("div", {
-      className: "vjs-fullscreen-control",
-      innerHTML: "<div><span></span><span></span><span></span><span></span></div>"
-    });
-    this.controls.appendChild(this.fullscreenControl);
-    this.activateElement(this.fullscreenControl, "fullscreenToggle");
-  }
-});
\ No newline at end of file
diff --git a/typo3/contrib/videojs/video-js/controls/audio-description.js b/typo3/contrib/videojs/video-js/controls/audio-description.js
new file mode 100644 (file)
index 0000000..168c2ab
--- /dev/null
@@ -0,0 +1,64 @@
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2011 Stanislas Rolland <typo3@sjbr.ca>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+/* Audio description Toggle Behaviors for videoJS */
+VideoJS.player.newBehavior("audioDescriptionToggle", function(element) {
+               _V_.addListener(element, "click", this.onAudioDescriptionToggleClick.context(this));
+       },{
+                       // When the user clicks on the audioDescription button, update audioDescription state
+               onAudioDescriptionToggleClick: function(event) {
+                       if (this.audioDescriptionEnabled) {
+                               this.disableAudioDescription();
+                       } else {
+                               this.enableAudioDescription();
+                       }
+               }
+       }
+);
+VideoJS.player.extend({
+               // Audio description state variable
+       audioDescriptionEnabled: false,
+               // Reference to the audio description audio element
+       audioDescription: null,
+               // Enable audio description
+       enableAudioDescription: function (event) {
+                       // Set reference if not yet done
+               if (!this.audioDescription) {
+                       var id = this.video.id.replace("video_js", "audio_element");
+                       this.audioDescription = document.getElementById(id);
+               }
+               if (this.audioDescription && this.audioDescription.nodeName == 'AUDIO') {
+                       this.audioDescription.muted = false;
+                       this.audioDescriptionEnabled = true;
+               }
+       },
+               // Disable audio description
+       disableAudioDescription: function (event) {
+               if (this.audioDescription && this.audioDescription.nodeName == 'AUDIO') {
+                       this.audioDescription.muted = true;
+                       this.audioDescriptionEnabled = false;
+               }
+       }
+});
\ No newline at end of file
diff --git a/typo3/contrib/videojs/video-js/controls/audio-description.png b/typo3/contrib/videojs/video-js/controls/audio-description.png
new file mode 100644 (file)
index 0000000..2150c5d
Binary files /dev/null and b/typo3/contrib/videojs/video-js/controls/audio-description.png differ
diff --git a/typo3/contrib/videojs/video-js/controls/captions.js b/typo3/contrib/videojs/video-js/controls/captions.js
new file mode 100644 (file)
index 0000000..38e35c4
--- /dev/null
@@ -0,0 +1,59 @@
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2011 Stanislas Rolland <typo3@sjbr.ca>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+/* Captions Toggle Behaviors for videoJS */
+VideoJS.player.newBehavior("captionsToggle",
+       function(element) {
+               _V_.addListener(element, "click", this.onCaptionsToggleClick.context(this));
+       },{
+               // When the user clicks on the subtitles button, update subtitles setting
+       onCaptionsToggleClick: function(event) {
+                       if (this.subtitlesDisplay.style.visibility != "hidden") {
+                               this.hideCaptions();
+                       } else {
+                               this.showCaptions();
+                       }
+               }
+       }
+);
+VideoJS.player.extend({
+               // Override to use captions kind of track rather than subtitles
+       getSubtitles: function(){
+               var tracks = this.video.getElementsByTagName("TRACK");
+               for (var i=0,j=tracks.length; i<j; i++) {
+                       if (tracks[i].getAttribute("kind") == "captions" && tracks[i].getAttribute("src")) {
+                               this.subtitlesSource = tracks[i].getAttribute("src");
+                               this.loadSubtitles();
+                               this.buildSubtitles();
+                       }
+               }
+       },
+       showCaptions: function (event) {
+               this.subtitlesDisplay.style.visibility = "visible";
+       },
+       hideCaptions: function (event) {
+               this.subtitlesDisplay.style.visibility = "hidden";
+       }       
+});
\ No newline at end of file
diff --git a/typo3/contrib/videojs/video-js/controls/captions.png b/typo3/contrib/videojs/video-js/controls/captions.png
new file mode 100644 (file)
index 0000000..33a56b1
Binary files /dev/null and b/typo3/contrib/videojs/video-js/controls/captions.png differ
diff --git a/typo3/contrib/videojs/video-js/controls/control-bar.css b/typo3/contrib/videojs/video-js/controls/control-bar.css
new file mode 100644 (file)
index 0000000..abfc66a
--- /dev/null
@@ -0,0 +1,27 @@
+/* Placement of Control Items 
+   - Left side of pogress bar, use left & width
+   - Rigth side of progress bar, use right & width
+   - Expand with the video (like progress bar) use left & right */
+.vjs-controls > div.vjs-play-control       { left: 5px;   width: 25px;  }
+.vjs-controls > div.vjs-progress-control   { left: 35px;  right: 221px; } /* Using left & right so it expands with the width of the video */
+.vjs-controls > div.vjs-time-control       { width: 75px; right: 156px;  } /* Time control and progress bar are combined to look like one */
+.vjs-controls > div.vjs-volume-control     { width: 50px; right: 101px;  }
+.vjs-controls > div.vjs-captions-control  { width: 31px; right: 65px;   }
+.vjs-controls > div.vjs-audio-description-control  { width: 25px; right: 35px;   }
+.vjs-controls > div.vjs-fullscreen-control { width: 25px; right: 5px;   }
+       /* Sub titles toggle*/
+.vjs-captions-control div { cursor: pointer !important; }
+.vjs-captions-control div {
+  padding: 0; text-align: left; vertical-align: top; cursor: pointer !important; 
+  margin: 5px 0 0 5px; /* Placement within the fullscreen control item */
+  width: 20px; height: 20px;
+}
+.vjs-captions-control div { background-image: url("captions.png"); background-repeat:no-repeat; background-position: center center;}
+       /* Audio description toggle*/
+.vjs-audio-description-control div { cursor: pointer !important; }
+.vjs-audio-description-control div {
+  padding: 0; text-align: left; vertical-align: top; cursor: pointer !important; 
+  margin: 5px 0 0 5px; /* Placement within the fullscreen control item */
+  width: 20px; height: 20px;
+}
+.vjs-audio-description-control div { background-image: url("audio-description.png"); background-repeat:no-repeat; }
\ No newline at end of file
diff --git a/typo3/contrib/videojs/video-js/controls/control-bar.js b/typo3/contrib/videojs/video-js/controls/control-bar.js
new file mode 100644 (file)
index 0000000..5cfc410
--- /dev/null
@@ -0,0 +1,166 @@
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2011 Stanislas Rolland <typo3@sjbr.ca>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+/* Extended control bar for videoJS */
+VideoJS.player.extend({
+  /* Control Bar override to add the subtitles control
+  ================================================================================ */
+  buildAndActivateControlBar: function(){
+    /* Creating this HTML
+      <div class="vjs-controls">
+        <div class="vjs-play-control">
+          <span></span>
+        </div>
+        <div class="vjs-progress-control">
+          <div class="vjs-progress-holder">
+            <div class="vjs-load-progress"></div>
+            <div class="vjs-play-progress"></div>
+          </div>
+        </div>
+        <div class="vjs-time-control">
+          <span class="vjs-current-time-display">00:00</span><span> / </span><span class="vjs-duration-display">00:00</span>
+        </div>
+        <div class="vjs-volume-control">
+          <div>
+            <span></span><span></span><span></span><span></span><span></span><span></span>
+          </div>
+        </div>
+        <div class="vjs-subtitles-control">
+          <div>
+            <span></span><span></span><span></span><span></span>
+          </div>
+        </div>
+        <div class="vjs-audio-description-control">
+          <div>
+            <span></span><span></span><span></span><span></span>
+          </div>
+        </div>
+        <div class="vjs-fullscreen-control">
+          <div>
+            <span></span><span></span><span></span><span></span>
+          </div>
+        </div>
+      </div>
+    */
+
+    // Create a div to hold the different controls
+    this.controls = _V_.createElement("div", { className: "vjs-controls" });
+    // Add the controls to the video's container
+    this.box.appendChild(this.controls);
+    this.activateElement(this.controls, "controlBar");
+    this.activateElement(this.controls, "mouseOverVideoReporter");
+
+    // Build the play control
+    this.playControl = _V_.createElement("div", { className: "vjs-play-control", innerHTML: "<span></span>" });
+    this.controls.appendChild(this.playControl);
+    this.activateElement(this.playControl, "playToggle");
+
+    // Build the progress control
+    this.progressControl = _V_.createElement("div", { className: "vjs-progress-control" });
+    this.controls.appendChild(this.progressControl);
+
+    // Create a holder for the progress bars
+    this.progressHolder = _V_.createElement("div", { className: "vjs-progress-holder" });
+    this.progressControl.appendChild(this.progressHolder);
+    this.activateElement(this.progressHolder, "currentTimeScrubber");
+
+    // Create the loading progress display
+    this.loadProgressBar = _V_.createElement("div", { className: "vjs-load-progress" });
+    this.progressHolder.appendChild(this.loadProgressBar);
+    this.activateElement(this.loadProgressBar, "loadProgressBar");
+
+    // Create the playing progress display
+    this.playProgressBar = _V_.createElement("div", { className: "vjs-play-progress" });
+    this.progressHolder.appendChild(this.playProgressBar);
+    this.activateElement(this.playProgressBar, "playProgressBar");
+
+    // Create the progress time display (00:00 / 00:00)
+    this.timeControl = _V_.createElement("div", { className: "vjs-time-control" });
+    this.controls.appendChild(this.timeControl);
+
+    // Create the current play time display
+    this.currentTimeDisplay = _V_.createElement("span", { className: "vjs-current-time-display", innerHTML: "00:00" });
+    this.timeControl.appendChild(this.currentTimeDisplay);
+    this.activateElement(this.currentTimeDisplay, "currentTimeDisplay");
+
+    // Add time separator
+    this.timeSeparator = _V_.createElement("span", { innerHTML: " / " });
+    this.timeControl.appendChild(this.timeSeparator);
+
+    // Create the total duration display
+    this.durationDisplay = _V_.createElement("span", { className: "vjs-duration-display", innerHTML: "00:00" });
+    this.timeControl.appendChild(this.durationDisplay);
+    this.activateElement(this.durationDisplay, "durationDisplay");
+
+    // Create the volume control
+    this.volumeControl = _V_.createElement("div", {
+      className: "vjs-volume-control",
+      innerHTML: "<div><span></span><span></span><span></span><span></span><span></span><span></span></div>"
+    });
+    this.controls.appendChild(this.volumeControl);
+    this.activateElement(this.volumeControl, "volumeScrubber");
+
+    this.volumeDisplay = this.volumeControl.children[0];
+    this.activateElement(this.volumeDisplay, "volumeDisplay");
+
+    // Create the captions control
+    this.captionsControl = _V_.createElement("div", {
+      className: "vjs-captions-control",
+      innerHTML: "<div><span></span><span></span><span></span><span></span></div>"
+    });
+    this.controls.appendChild(this.captionsControl);
+       // Hide the control if there are no tracks
+    var tracks = this.video.getElementsByTagName("TRACK");
+    if (tracks.length) {
+         this.activateElement(this.captionsControl, "captionsToggle");
+    } else {
+         this.captionsControl.style.display = "none";
+    }
+
+    // Create the audio description control
+    this.audioDescriptionControl = _V_.createElement("div", {
+      className: "vjs-audio-description-control",
+      innerHTML: "<div><span></span><span></span><span></span><span></span></div>"
+    });
+       // Look for the audio description associated with this video element
+       // We could look for audio with same mediagroup...
+    var id = this.video.id.replace("video_js", "audio_element");
+    var audioDescription = document.getElementById(id);
+    if (!!audioDescription) {
+           this.controls.appendChild(this.audioDescriptionControl);
+           this.activateElement(this.audioDescriptionControl, "audioDescriptionToggle");
+    } else {
+           this.audioDescriptionControl.style.display = "none";
+    }
+
+    // Crete the fullscreen control
+    this.fullscreenControl = _V_.createElement("div", {
+      className: "vjs-fullscreen-control",
+      innerHTML: "<div><span></span><span></span><span></span><span></span></div>"
+    });
+    this.controls.appendChild(this.fullscreenControl);
+    this.activateElement(this.fullscreenControl, "fullscreenToggle");
+  }
+});
\ No newline at end of file
index c87cb81..fe67c70 100644 (file)
@@ -230,8 +230,8 @@ class FlowPlayerContentObject extends \TYPO3\CMS\Frontend\ContentObject\Abstract
                // Add videoJS css-file
                $GLOBALS['TSFE']->getPageRenderer()->addCssFile(TYPO3_mainDir . 'contrib/videojs/video-js/video-js.css');
                // Add extended videoJS control bar
-               $GLOBALS['TSFE']->getPageRenderer()->addJsFile(TYPO3_mainDir . '../t3lib/js/videojs/control-bar.js');
-               $GLOBALS['TSFE']->getPageRenderer()->addCssFile(TYPO3_mainDir . '../t3lib/js/videojs/control-bar.css');
+               $GLOBALS['TSFE']->getPageRenderer()->addJsFile(TYPO3_mainDir . 'contrib/videojs/video-js/controls/control-bar.js');
+               $GLOBALS['TSFE']->getPageRenderer()->addCssFile(TYPO3_mainDir . 'contrib/videojs/video-js/controls/control-bar.css');
                // Build Flash configuration
                $player = isset($typeConf['player.']) ? $this->cObj->stdWrap($typeConf['player'], $typeConf['player.']) : $typeConf['player'];
                if (!$player) {
@@ -346,7 +346,7 @@ class FlowPlayerContentObject extends \TYPO3\CMS\Frontend\ContentObject\Abstract
                        // Assemble captions track tag
                        $videoCaptions = '<track id="' . $replaceElementIdString . '_captions_track" kind="captions" src="' . $conf['caption'] . '"></track>' . LF;
                        // Add videoJS extension for captions
-                       $GLOBALS['TSFE']->getPageRenderer()->addJsFile(TYPO3_mainDir . '../t3lib/js/videojs/captions.js');
+                       $GLOBALS['TSFE']->getPageRenderer()->addJsFile(TYPO3_mainDir . 'contrib/videojs/video-js/controls/captions.js');
                        // Flowplayer captions
                        $conf['videoflashvars']['captionUrl'] = $conf['caption'];
                        // Flowplayer captions plugin configuration
@@ -360,7 +360,7 @@ class FlowPlayerContentObject extends \TYPO3\CMS\Frontend\ContentObject\Abstract
                if ($conf['type'] == 'video') {
                        if (is_array($conf['audioSources']) && count($conf['audioSources'])) {
                                // Add videoJS audio description toggle
-                               $GLOBALS['TSFE']->getPageRenderer()->addJsFile(TYPO3_mainDir . '../t3lib/js/videojs/audio-description.js');
+                               $GLOBALS['TSFE']->getPageRenderer()->addJsFile(TYPO3_mainDir . 'contrib/videojs/video-js/controls/audio-description.js');
                        }
                        if (isset($conf['audioFallback'])) {
                                // Audio description flowplayer config (remove controls)
@@ -717,4 +717,4 @@ class FlowPlayerContentObject extends \TYPO3\CMS\Frontend\ContentObject\Abstract
 }
 
 
-?>
\ No newline at end of file
+?>