Getting handle values

manuman94 edited this page May 7, 2014 · 7 revisions

Getting handle values

The ytCropper library has methods to obtain the handle values. The library has also one method that returns a embed YouTube video link prepared to play the interval specified in the cropper.

  • ytCropper::getInitialValue()
    Returns the first handle value in seconds (the first interval value).

  • ytCropper::getFinalValue()
    Returns the second handle value in seconds (the last interval value).


        // Prevent the default behaviour of <a> tag
        // Obtain the first value and put it into #firstInput
        // Obtain the first value and put it into #secondInput
        // Obtain the embed link and put it into #generatedCode

This code means that, when the generateButton is pressed, changes the #firstInput, #secondInput and #generatedCode with the first handle value, second handle value and embed YouTube link.

You can test it here:

More information about this plugin on this wiki.