f792d24_part_12_JamendoPlayer_3.js 980B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. function JamendoPlayer(ref_id, object_for_player, finish_callback)
  2. {
  3. var _ref_id = ref_id;
  4. var _object_for_player = object_for_player;
  5. var _player = null;
  6. var _finish_callback = finish_callback;
  7. this.play = function()
  8. {
  9. _player = new GenericStreamingPlayer(_ref_id, _object_for_player,
  10. event_play,
  11. event_end,
  12. event_error,
  13. event_finish_playlist);
  14. _player.create_player();
  15. }
  16. var event_play = function()
  17. {
  18. }
  19. var event_end = function()
  20. {
  21. }
  22. var event_error = function()
  23. {
  24. _finish_callback();
  25. }
  26. var event_finish_playlist = function()
  27. {
  28. _finish_callback();
  29. }
  30. this.stop = function()
  31. {
  32. _player.stop();
  33. }
  34. this.pause = function()
  35. {
  36. _player.pause();
  37. }
  38. this.destroy = function()
  39. {
  40. _player.destroy();
  41. }
  42. this.stopAndDestroy = function()
  43. {
  44. this.stop();
  45. this.destroy();
  46. }
  47. this.close = function()
  48. {
  49. this.stopAndDestroy();
  50. }
  51. }