JavaScript - Yahoo Mediaplayer Api Setqueueviewstate
Hello forum
I have successfully added the yahoo media player to my website but now I am stuck on one minor customization due to my lack of java-script knowledge. I want to expand the playlist by default on page load... Here are the examples via: http://mediaplayer.yahoo.com/api Quote: METHODS: setQueueViewState: Code: void setQueueViewState ( viewState ) "API function to set the visual state of the playlist queue" Parameters: viewState (number) A number representing the visual state of the playlist queue,0:minimized, 1: maximized Returns: Boolean Returns true when setting the state is done successfully, false otherwise How can I integrate that^ into the following example code below so that the queue is maximized when the page loads? Code: <script type="text/javascript"> var YMPParams = { autoplay:true, volume:0.5, defaultalbumart:'http://somedomain.com/path/someimage.gif' } </script> <script type="text/javascript" src="http://mediaplayer.yahoo.com/latest"> /* This will include the yahoo media player on the page */ </script> <script type="text/javascript"> var apiReadyHandler = function () { /* Once API ready handler is invoked, YAHOO.MediaPlayer class can be accessed safely */ /* For example: Add other event listeners **/ YAHOO.MediaPlayer.onPlaylistUpdate.subscribe(onPlaylistUpateHandler) } var onPlaylistUpateHandler = function (playlistArray) { /* Handler for onPlaylistUpdate event */ alert(" playlist count = " + YAHOO.MediaPlayer.getPlaylistCount()) } YAHOO.MediaPlayer.onAPIReady.subscribe(apiReadyHandler); </script> If anyone can help me out by showing me an example that would be great! I have been stuck on this for hours already Thank you so much! Similar TutorialsHi, I am using Yahoo Table (YUI Library). I have a question regarding selected row data. I am using the following command to select the row but how I can get the selected row data. MyDataTable.subscribe("rowClickEvent", MyDataTable.onEventSelectRow); I want to create a second Yahoo Table based on row selection( I need the first column value to generate this table. Code: YAHOO.example.AssesmentsTable = function() { var MyColumnDefs = [ {key:"objectid", label: "#",formatter: YAHOO.widget.DataTable.formatAxsOppLink}, {key:"ClaimantName", label: "Claimant Name",sortable:true}, {key:"ClaimantAddress", label: "Claimant Address",sortable:true}, {key:"ClaimantPhone", label: "Claimant Phone",sortable:true}, {key:"ServiceType", label: "Service Type",sortable:true}, {key:"StartDate", label: "Start Date",sortable:true}, {key:"StartTime", label: "Start Time",sortable:true}, {key:"Location", label: "Service Location",sortable:true}, {key:"PartOfAMulti", label: "Part of a Multi?",sortable:true}, {key:"InterpreterName", label: "Interpreter",sortable:true}, {key:"AssessorsNames", label: "Assessors",sortable:true}, {key:"DateReportDueToUs", label: "Date Report Due",sortable:true} ]; var MyDataSource = new YAHOO.util.DataSource(gAssessorAxs); MyDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY; MyDataSource.responseSchema = {fields: ["objectid","ClaimantName","ClaimantAddress","ClaimantPhone","ServiceType","StartDate","StartTime","Location","PartOfAMulti","InterpreterName","AssessorsNames","DateReportDueToUs"]}; var MyConfigs = {paginator : new YAHOO.widget.Paginator({rowsPerPage: 10})}; var MyDataTable = new YAHOO.widget.DataTable("AssesmentsTable", MyColumnDefs, MyDataSource,MyConfigs); //MyDataTable.hideColumn(1); MyDataTable.set("selectionMode", "single"); MyDataTable.subscribe("rowMouseoverEvent", MyDataTable.onEventHighlightRow); MyDataTable.subscribe("rowMouseoutEvent", MyDataTable.onEventUnhighlightRow); MyDataTable.subscribe("rowClickEvent", MyDataTable.onEventSelectRow); return { oDS: MyDataSource, oDT: MyDataTable }; }(); Thanks. I use Firefox with Greasemonkey and a javascript that "keeps sorting in Y Fantasy Full games"... It stopped working this year and the site that I got it at (http://userscripts.org) has been down recently... I do not know javascript, so I have no idea where to begin... Any one have any idea what this isn't keeping the selected sort when one changes player types? Code: // ==UserScript== // @name Keep sorting in Y Fantasy Full Games // @namespace * // @description On the My Team Page, keeps the selected view when changing days, other stats. On the Player Search page, keeps the sort when changing player types. // @include http://*.fantasysports.yahoo.com/*/* // ==/UserScript== (function() { // my team age -- when changing dates, keep view loc_search=document.location.search; if(document.getElementById('datenav')){ datenav=document.getElementById('datenav'); links=datenav.getElementsByTagName('a'); loc_search=document.location.search; loc_search=loc_search.replace(/date=[\-0-9]*/,""); loc_search=loc_search.replace(/\?/,""); for (var i in links){ if(links[i].href){href=links[i].href; href=href.replace(/$/,loc_search); links[i].href=href; }} } loc_search=document.location.search; loc_search=loc_search.replace(/(status=\w*|pos=\w*|stat1=\w*|count=[0-9]*)/g,""); loc_search=loc_search.replace(/&&+/g,"&"); loc_search=loc_search.replace(/(^\?&|&$)/g,""); // Player search page. When changing stat filters, keep sort if(document.getElementById('statusselect')){ sel=document.getElementById('statusselect'); data=loc_search.split('&'); for (var i in data){ parts=data[i].split('='); ele=document.createElement( 'input' ); ele.type='hidden'; ele.name=parts[0]; ele.value=parts[1]; sel.parentNode.insertBefore(ele,sel); } } // back to my team page. if changing in subnav (ie, ave stats to stats, keep timeframe) if(document.getElementById('statnav')){ nav=document.getElementById('statnav'); links=nav.getElementsByTagName('a'); // GM_log(links.length); for (i in links){ if(links[i].href){href=links[i].href; if(! href.match(/stat2/) && ! href.match(/stat1=R/)){ //GM_log(href + links[i]); if(href.match(/stat1=A/)){loc_search=loc_search.replace(/stat2=L/,"stat2=AL")} if(href.match(/stat1=A/)){loc_search=loc_search.replace(/stat2=S/,"stat2=AS")} if(href.match(/stat1=S/)){loc_search=loc_search.replace(/stat2=AL/,"stat2=L")} if(href.match(/stat1=S/)){loc_search=loc_search.replace(/stat2=AS/,"stat2=S")} links[i].href=links[i].href+"&"+loc_search; }} } } })() |