Results 1 to 6 of 6

Thread: AllowShuffle param for playlists

  1. #1
    Join Date
    Jan 2005

    AllowShuffle param for playlists

    I am not sure why the AllowShuffle is not actually playing the songs in a random fashion in my playlist below. Has anyone experienced this and know what the correct way to code this up is? When I start the below playlist in windows media player, the songs are played sequentially, then repeated. I need for them to play randomly then when all songs are done repeat the same process of randomized play. Thanks in advance.

    <ASX version ="3.0">
    <Param Name = "AllowShuffle" Value = "yes" />
    <DURATION VALUE="00:00:30" />
    <Ref href="song1.mp3"/>
    <StartTime value="00:00:60" />
    <DURATION VALUE="00:00:30" />
    <Ref href="song2.mp3"/>
    <DURATION VALUE="00:00:30" />
    <Ref href="song3.mp3"/>
    <DURATION VALUE="00:00:30" />
    <Ref href="song4.mp3"/>

  2. #2
    Join Date
    Jan 2005
    I've done some testing and found that the AllowShuffle does not actually randomize the playlist, but rather overrides the users ability to shuffle a playlist. If Value is "no" then all the songs in the users playlist will play sequencially regardless of whether the shuffle option on the player is checked. Whereas if the value is Yes then the user can actually have sounds played in a random fashion. I still have not found an option that will shuffle my playlist anyone know of that option? I have a script that will select random songs but it conflicts with another script I have because both use the onload command. So I'm looking for a built in param. Thanks.

  3. #3
    Join Date
    Jun 2004
    Kansas City, MO
    Im not sure about that, but is there any way you could do a random number, and create you own kind or auto shuffle. Lets say you have the 5 links below.

    When you open the page call a function that will display those links in a random order. They will (assuming i read your last posts correclty) will play from top to bottom but they will always dispaly differenly every time the page is refreshed.

    How about something like that.

  4. #4
    Join Date
    Jan 2005
    I got the below script from user Warren86 and it works fine. I modified it to play playlists instead of single songs. By using a playlist I am able to play numerous multiple songs as opposed to playing one random song. The issue with using this script is that I have another script that displays a slide show both using the onload command. So in this case the last script that I source in my html will win. i.e.

    <script type="text/javascript" src=script1.js></script>
    <script type="text/javascript" src=script2.js></script>

    Therefore script2 will function and script1 will not. To get around this I said I would leave the slide show and look for a built in option for the playlist to randomly play songs from a playlist. What I said before about the AllowShuffle is correct, try it out when you get a chance. Create a playlist similar to what I have and run the playlist both with the shuffle option on and off from windows media player.

    <Script Language=JavaScript>

    audioClip = new Object
    audioClip.A = "http://french.about.com/library/media/wavs/zero.wav"
    audioClip.B = "http://french.about.com/library/media/wavs/1.wav"
    audioClip.C = "http://french.about.com/library/media/wavs/2.wav"
    audioClip.D = "http://french.about.com/library/media/wavs/3.wav"

    var nClips = new Array();
    n = 0;

    for (each in audioClip){nClips[n++] = audioClip[each]}

    isMax = nClips.length-1;

    function getClip(){

    isIndex = 0+Math.round(Math.random()*isMax);
    currClip = nClips[isIndex];

    function playIt(URL){

    isSelection = URL;
    embedStr = "<Embed Src="+isSelection+" Width=0 Height=0></Embed>"
    document.getElementById('isEmbed').innerHTML = embedStr;


    <Div id='isEmbed'></Div><br>

  5. #5
    Join Date
    Apr 2013

    Alternative to random integer

    1. Check your ASX file is working, this can be done using your existing code or opening it in Windows Media Player.
    Make sure that your ASX contains this line <param name="AllowShuffle" value="Yes">

    2. Change your <object> tag to this:
    <input id="shuffle" style="display:none;" onClick="shufflePlayer()">
    function shufflePlayer()
    MPlayer.Settings.setMode("shuffle", 1);
    MPlayer.url= file.asx /* replace with the name of file */

    <object id="MPlayer"
    <param name="Showcontrols" value="True">

    <param name="autoStart" value="True"> <!-- Recommended, not required though -->
    <param name="AllowShuffle" value="Yes"> <!-- Required -->
    <param name="Volume" value="100">
    <param name="EnableContextMenu" value="False"><!-- to stop people trying to change things -->

    3. Then add this line of code to the onload function i.e.

    (This is to avoid conflict with any other onload scripts taking place)
    4. If it is not working, with MP3 files.
    You can switch to WPL format, which is simpler too (don't if you are using ASF files though):

    <?wpl version="1.0"?>
    <meta name="Generator" content="Microsoft Windows Media Player -- 12.0.9200.16384"/>
    <meta name="IsNetworkFeed" content="0"/>

    <media src="file1.mp3"/>
    <media src="file2.mp3"/>

  6. #6
    Join Date
    Apr 2013
    What you need for your situation is:
    Option A :
    Keep Reading
    Create a hidden input button:
    <input id="randomiserbtn" onClick="name of script here" style="display:none" type="button">

    Add this line to the end or where appropriate to the loading script

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.12717 seconds
  • Memory Usage 2,886KB
  • Queries Executed 15 (?)
More Information
Template Usage (32):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (6)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates