+</div>
+
+<?php // Javascript bindings when document is ready ?>
+<script type="text/javascript">
+ $(function() {
+ // TODO remove this 2 bindings
+ $('#a_ns-vlc').click(function() {
+ //retrieveNsVlcPlugin('<? //echo $video['url'][0] ?>');
+ });
+ $('#a_ns-html5').click(function() {
+ //retrieveNsHtml5Plugin('<?php //echo $video['url'][0] ?>')
+ });
+
+ // Switch video plugin facilities
+ $('#video-widget-tabs').tabs(); /*{
+ ajaxOptions: {
+ type: "POST",
+ data: { url: "<?php //echo $video['url'][0] ?>" },
+ error: function(xhr, status, index, anchor) {
+ $(anchor.hash).html('Could not load the video plugin.');
+ }
+ }
+ });*/
+ $('#switch-to-ns-html5')
+ .click(function() {
+ $('#video-widget')
+ .nsvideo('type', 'ns-html5');
+ });
+ $('#switch-to-ns-vlc')
+ .click(function() {
+ $('#video-widget')
+ .nsvideo('type', 'ns-vlc');
+ });
+
+ // Video widget
+ $('#video-widget').nsvideo({
+ type: "<?php echo $plugin_type ?>",
+ definition:
+ "<?php echo $video['assets'][ $asset_index ]['def'] ?>",
+ src: {
+ <?php
+ for ($i=0; $i < count($video['assets']); $i++)
+ {
+ $asset = $video['assets'][$i];
+ echo '"'. $asset['def'] . '": ';
+ echo '"'. $asset['src'] . '"';
+ echo ($i == count($video['assets']) - 1) ? '' : ', ';
+ }
+ ?>
+ }
+ });
+ });
+</script>
\ No newline at end of file