A simple jQuery input mask for SMPTE timecode
timecodeinputmask is a jQuery library which creates an input mask for easily entering SMPTE timecode.
Include the main js file
<script src="jquery.js"></script>
<script src="jquery.timecodeinputmask.js"></script>$(selector).timecodeinputmask(options)<input type="text" data-timecodeinputmask />Any option can be passed through the use of a data attribute. Use data-timecodeinputmask-<the name of the option>="value"
Allow the timecode to be negative by pressing - key anywhere in the input field.
Default: false
Define the framerate. This is useful for automatically set the maxValue of the FF group.
Default: 25
Define the format of the mask. See Groups definitions. Default: HH:MM:SS:FF
HH: HoursMM: MinutesSS: SecondsFF: Frames
You can use the groups option to define custom groups options.
Available properties are:
start: The 0-based index of the first character of the group.end: The 0-based index of the character after the last character of the group.maxValue: maximum value of the group
groups: [
{
start: 0,
end: 2,
maxValue: 23
},
{
start: 3,
end: 5,
maxValue: 59
},
{
start: 6,
end: 8,
maxValue: 59
}...
]