thd/web/js/segmentation/.svn/text-base/segments.js.svn-base
author Gautier Thibault <gthibault@universcine.com>
Tue, 22 Sep 2009 16:40:38 +0200
changeset 35 94a1dc255022
permissions -rw-r--r--
Commit the all thd project created with the framework symfony
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
     1
// SegmentMarker
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
     2
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
     3
var segmentMarker = {
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
     4
    
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
     5
    mkin: 0,
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
     6
    mkout: 0,
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
     7
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
     8
    markIn: function() {
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
     9
        // Besoin d'arrondir à cause de la precision limitee
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    10
        // des cuepoints.
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    11
        this.mkin = Math.round($f().getTime() * 10) / 10;
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    12
        $("#btMarkOut").removeAttr("disabled");
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    13
        $("#frmIn").val(this.mkin * 1000);
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    14
    },
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    15
    
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    16
    markOut: function() {
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    17
        player = $f();
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    18
        player.pause();
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    19
        this.mkout = Math.round(player.getTime() * 10) / 10;
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    20
        $("#btPlaySegment").removeAttr("disabled");
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    21
        $("#frmOut").val(this.mkout * 1000);
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    22
        $("#mkin").text(this.mkin);
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    23
        $("#mkout").text(this.mkout);
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    24
        $("#segmentForm").show();
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    25
        // Arrete la lecture sur la marque de sortie de segment
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    26
        player.onCuepoint([this.mkout * 1000],
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    27
                          function(clip, cue) {
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    28
                              segmentMarker.stopOnOut(cue);
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    29
                          });
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    30
    },
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    31
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    32
    playSegment: function() {
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    33
        player = $f();
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    34
        player.seek(this.mkin);
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    35
        player.play();
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    36
    },
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    37
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    38
    stopOnOut: function(cuepoint) {
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    39
        if (cuepoint == this.mkout * 1000)
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    40
            $f().pause();
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    41
    }
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    42
94a1dc255022 Commit the all thd project created with the framework symfony
Gautier Thibault <gthibault@universcine.com>
parents:
diff changeset
    43
};