alphaTab - Player

Back

This sample shows how to display a GuitarPro file.
Note: The callback function needs to be a declared function that java can call it by name.

Source

<!-- Include the Player Plugin --> <script language="JavaScript" type="text/javascript" src="../lib/alphaTab/jquery.alphaTab.player.js"></script> <script language="JavaScript" type="text/javascript"> var api = null; (function($) { $(document).ready(function() { api = $('div.alphaTab').alphaTab({ //context: alphatab.platform.PlatformFactory.SVG_CANVAS, file: 'files/Rohan.gp5', }).player({ // enable the player //caretOffset: {x: 7, y: -7}, // small offset because of the css3 features playerTickCallback: "onTickChanged" // !required! }); }); })(jQuery); // !required! function onTickChanged(tickPosition) { api.updateCaret(tickPosition); } </script> <div class="alphaTab"></div>