This is a message.

Forum user: Steve_K

Basic information

Registered Jun 3, 2009
Last login Aug 14, 2009
Forum posts 10
Direct URL http://www.flowplayer.org/forum/users/11303

Latest forum posts

Posts:

Registered:

Getting properties from the currently playing clip onBegin

Posted: Aug 14, 2009

Hello!
I currently have a site which uses flowplayer and the playlist plugin. My playlist is a list of thumbnail links which trigger the player. The playlist is actually a box with two tabs and each tab loads new content via ajax and a php file. The thumbnails tab is the one in which the list of thumbnails is located, and the second tab shows a description for the currently playing video when clicked.

My problem is that I need to access the number of the clip which is currently playing in order to use it in my ajax call to the view description tab. This way, if the user clicks the description tab while the clip is playing, the php will use the number to show it.

Simple version:
How can I reference the number of the currently playing clip inside of that clip's onBegin() method?

Thanks so much, and I apologize for the verbose explanation!

Posts:

Registered:

Haha!

Posted: Jun 6, 2009

Nice one! :)

For some reason, I thought that doing .scrollable() again on the div would do the same as api.reload()... Whoops!

Thanks for the answer, I'll try it out!

I had another question about using the tools with ajax, etc. Right now, my page has a heading which needs to be dynamically generated and also a playlist which needs to be generated as well. I want to keep the player from refreshing, so I keep that static and just use ajax to grab the heading stuff and the playlist stuff.

Right now, I have to use two $.ajax() calls to two separate php pages. My first question is, do you know if it's possible to get two responseTexts from a single php file, or is my method of using two PHP scripts the way it's done. Was thinking I might have to look into JSON, but I'm not sure... Thought perhaps you may have done this kind of setup, so I thought I would ask.

Secondly, since my playlist gets pulled in from a php file which essentially echoes stuff out for it, I've found that I need to use a second <script> for any stuff dealing with .scrollable() or anything else related to flowplayer. (I usually like to put all of that in an external .js file.) Is this normal when using php pages for ajax with flowplayer, or am I doing something wrong?

Thanks for reading, and for any help you might be willing to offer!
SK

Posts:

Registered:

Dynamically generated scrollable() size...

Posted: Jun 6, 2009

Looks like I spoke too soon. Here's the code I am using:


var api = $("div.scrollable").scrollable({api: true});
var item_count = $("div.scrollable div.items a").length;
			
if(item_count < api.getConf().size) {
  api.getConf().size = item_count; 
}
else {
  api.getConf().size = 4;
}

// reinit
$("div.scrollable").scrollable()

My hope is that, when I load my lists of items dynamically, if they have less then four items in them, the next link will disappear due to the size being dynamically adjusted. Can anyone offer suggestions for what I may be missing?

Thanks!
SK

Posts:

Registered:

Awesome

Posted: Jun 6, 2009

Thanks! I had read in the api docs that api.getSize() was identical.
In any case, I found the error of my logic and corrected it. Works like a charm when you compare getConf().size to the length of the entries in .scrollable() and then generate the size dynamically based on that.

Thanks for your help!
SK

Posts:

Registered:

Any word?

Posted: Jun 5, 2009

Just wondering if there's any word on IE6 functionality?
Thanks!

SK

Posts:

Registered:

Dynamically resize scrollable content

Posted: Jun 5, 2009

Hi,

I'm trying to dynamically resize my scrollable content based on how many entries I have. My entries are split into categories and are dynamically loaded. However, some categories have less than 4 entries, which is what the 'size' property of the scrollable content has been set to.

Here's a bit of code I am trying to use to change the amount of elements when they're less than 4 (size), as well as change the width of the container so that the next graphic is next to the last element when there are less than four of them. Currently, my scrollable content is in a wrapper called #playlist_wrapper. Here's my code so far:


	  <script type="text/javascript">
		  var api = $("div.scrollable").scrollable({api: true});
			var elements = api.getSize();
			if(elements < 4) {
				api.size = elements;
				$("#playlist_wrapper").css('width', 'XXpx');
			}
			else {
				api.size = 4;
			}
			// reinit
			$("div.scrollable").scrollable();
		</script>


So far, it still looks like it's holding extra entry spaces when I try to resize the container. Am I on the right track?

Thanks!
SK

Posts:

Registered:

Went with links...

Posted: Jun 5, 2009

Thanks very much for your reply, I decided to make the links work for what I need, and they're working great. I have one other question which may need to be moved to another topic, but I'm not sure.

Currently, I have a page which has a player and a playlist, as well as a select tag with four options which are categories of movies. When the user selects an option, I do a $_POST via .ajax to a php file where, depending on the option from the select, an array of items is set which contains the code for the entries for the proper category. At this point, the php file also holds an anchor for the player, as well. (The PHP ajax content player is the same id as the original player)

Now, everything loads great, the different clips show up in the scroller and the players load from the php page as long as I include the bit of script for them on that page.

The problem is that even though the ajax response's player/playlist combo and the original page's are the same, when I select an option and get ajax-generated content, and then choose a playlist item to play, I get a 404 Not Found Error, and then a path to a file which suggests the baseUrl is being ignored.

Can you offer some insight into this for me as to what I'm missing?
Do I perhaps need a different player id / playlist id for each category as well?

Thanks for reading, sorry this is so long!
SK

Posts:

Registered:

Scrollable Playlist Problems...

Posted: Jun 5, 2009

I apologize if this forum isn't supposed to be used for helping with specific code examples, but I've been pouring over this for hours now, and while it seems to be quite close, I find I still cannot get a scrollable playlist to work.

I've pasted my code over at http://www.pastie.org/501319 as I didn't realize I might be able to paste it here. The pastie example has both my JS code and my HTML code. Also, an 'almost-working' example is here:

http://www.kuklamusic.com/theater.php

What's odd about this is that I managed to get the player, the playlist plugin, and the scrollable tool to work all independently (as in, the playlist plugin triggered the player without the scrollable tool), but no dice when including scrollable, although the clips do scroll, and the player seems to attempt to load something...

Anyway, just wanted to show that I've tried to do my homework before asking for help! Any advice or help with this is greatly appreciated!

Thanks!
SK

EDIT: After some more experimentation, I find that I can only get a horizontal scrollable playlist to work if I use anchor tags to hold all of my clip details instead of div tags. Is this the way it ought to be, or is there a way to get the code I pasted above to work by using divs for the individual playlist elements?

Posts:

Registered:

Solved!

Posted: Jun 5, 2009

I managed to get it by styling the scrollable element with margin auto in order to move the entire container. (Which makes sense, given that it's not only the container, but the element that doesn't move.)

Thanks for your help!

SK

Posts:

Registered:

Scrollable Object Positioning

Posted: Jun 5, 2009

Hello!
I realize this is more of a CSS question that a JS one, but, am I correct in figuring that a scrollable object's position must be absolute, and therefore, can't be centered with auto margins?

If this is incorrect, I am a bit unclear as to which item I can style to center the content. Any help is greatly appreciated!

Much thanks!

SK