audioTracks method
Implementation
Future<List<dynamic>> audioTracks() {
return webViewController.runJavaScriptReturningResult('''
(function() {
var audioTracks = player.audioTracks();
var arrayList = [];
Array.from(audioTracks).forEach(function(track) {
var trackObj = {
default: track.default || false,
enabled: track.enabled || false,
id: track.id || '',
kind: track.kind,
label: track.label,
language: track.language,
mode: track.mode
};
arrayList.push(trackObj);
});
return JSON.stringify(arrayList);
})();
''').then((v) {
return jsonDecode(v.toString());
});
}