mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-27 22:17:32 +01:00
Switch jukebox from WMP to VLC (CROSS PLATFORM, OGG SUPPORT)
This commit is contained in:
@@ -6,8 +6,36 @@
|
||||
* Rewritten (except for player HTML) by N3X15
|
||||
***********************/
|
||||
|
||||
// Open up WMP and play musique.
|
||||
// TODO: Convert to VLC for cross-platform and ogg support. - N3X
|
||||
// Open up VLC and play musique.
|
||||
// Converted to VLC for cross-platform and ogg support. - N3X
|
||||
var/const/PLAYER_HTML={"
|
||||
<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org" />
|
||||
<object classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" codebase="http://download.videolan.org/pub/videolan/vlc/last/win32/axvlc.cab" id="player"></object>
|
||||
<script>
|
||||
function noErrorMessages () { return true; }
|
||||
window.onerror = noErrorMessages;
|
||||
function SetMusic(url, time, volume) {
|
||||
var vlc = document.getElementById('player');
|
||||
|
||||
// Stop playing
|
||||
vlc.playlist.stop();
|
||||
|
||||
// Clear playlist
|
||||
vlc.playlist.items.clear();
|
||||
|
||||
// Add new playlist item.
|
||||
var id = vlc.playlist.add(url);
|
||||
|
||||
// Play playlist item
|
||||
vlc.playlist.playItem(id);
|
||||
|
||||
vlc.input.time = time*1000; // VLC takes milliseconds.
|
||||
vlc.audio.volume = volume*100; // \[0-200]
|
||||
}
|
||||
</script>
|
||||
"}
|
||||
|
||||
/* OLD, DO NOT USE. CONTROLS.CURRENTPOSITION IS BROKEN.
|
||||
var/const/PLAYER_HTML={"
|
||||
<OBJECT id='player' CLASSID='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' type='application/x-oleobject'></OBJECT>
|
||||
<script>
|
||||
@@ -20,6 +48,7 @@ function SetMusic(url, time, volume) {
|
||||
player.Settings.volume = volume;
|
||||
}
|
||||
</script>"}
|
||||
*/
|
||||
|
||||
// Hook into the events we desire.
|
||||
/hook_handler/soundmanager
|
||||
|
||||
Reference in New Issue
Block a user