Reply
Visitor
Greg
Posts: 4
Registered: ‎01-14-2011
0 Kudos

Displaying number of videos in playlist in Label

I would like to display the total number of videos available in a playlist. I'm looking for something like {videoList.length}.

 

Here's a snippet. The label is to appear above the playlist:

 

<Canvas height ="27" width="260">
<Label text="{videoList.length}" height="25" multiline="false" truncate="true"/>
</Canvas>
<List id="videoList" width="260" rowHeight="54" automaticAdvance="true" data="{playlistTabs.selectedItem.videoDTOs}" selectOnClick="true" itemInsetV="4" itemLeading="2">
...

Any suggestions?

 

 

Brightcove Team
BC-Mel
Posts: 56
Registered: ‎04-22-2009
0 Kudos

Re: Displaying number of videos in playlist in Label

Hi Greg,

 

Does

 

<Label text="{playlistTabs.selectedItem.videoDTOs.length}" height="25" multiline="false" truncate="true"/>

work for you?  (I'm using what the List's data property is being set to in your example.)

 

Best,

Mel

Visitor
Greg
Posts: 4
Registered: ‎01-14-2011
0 Kudos

Re: Displaying number of videos in playlist in Label

Hello Mel,

 

Thanks for your quick response. I have made the suggested change, but I still don't see the number of videos (nothing is displayed).

 

Do you have any other suggestions?

 

Regards,

 

Greg

Brightcove Team
BC-Mel
Posts: 56
Registered: ‎04-22-2009
0 Kudos

Re: Displaying number of videos in playlist in Label

Hi Greg,

 

That's odd -- it worked in my smoke test.  Would you mind posting your full BEML?

 

Thanks,

Mel

Visitor
Greg
Posts: 4
Registered: ‎01-14-2011
0 Kudos

Re: Displaying number of videos in playlist in Label

Mel, sure thing, here it is:

 

<Runtime>
  <Theme name="Deluxe" style="Light">
    <Style id="default"><![CDATA[.titleText {fontSize: 12;}.bodyText {fontSize: 10;}.linkText {fontSize: 10;}]]></Style>
  </Theme>
  <Layout id="application" boxType="vbox" padding="8" gutter="4">
    <HBox gutter="4" width="630">
      <ChromelessVideoPlayer width="370" id="videoPlayer" useOverlayMenu="false" video="{videoList.selectedItem}">
      </ChromelessVideoPlayer>
      <VBox>
        <Canvas height ="27" width="260" style="background-color:#428385">
          <Label text="{playlistTabs.selectedItem.videoDTOs.length}" y="4" x="9" size="12" style="bodyText:#ffffff;bodyText-selected:#ffffff;bodyText-active:#ffffff;bodyText-rollover:#ffffff" height="25" multiline="false"  truncate="true"/>
        </Canvas>
        <List style="background-color:#FF0000" showBack="false" id="videoList" width="260" rowHeight="54" automaticAdvance="true" data="{playlistTabs.selectedItem.videoDTOs}" selectOnClick="true" itemInsetV="4" itemLeading="2">
          <ListItem showBack="false" boxType="hbox">
            <Spacer width="8"/>
            <VBox width="64" height="44" vAlign="middle">
              <ThumbnailButton height="50" data="{currentItem}" source="{currentItem.thumbnailURL}"/>
            </VBox>
            <Spacer width="7"/>
            <VBox>
              <Spacer height="4"/>
              <TitleLabel height="16" text="{currentItem.displayName}" multiline="true"/>
              <Label height="52" multiline="true" text="{currentItem.shortDescription}" truncate="true"/>
            </VBox>
            <Spacer width="3"/>
          </ListItem>
        </List>
      </VBox>
    </HBox>
  </Layout>
</Runtime>

 

Brightcove Team
BC-Mel
Posts: 56
Registered: ‎04-22-2009
0 Kudos

Re: Displaying number of videos in playlist in Label

Ah, I was thrown off by this:

 

<List style="background-color:#FF0000" showBack="false" id="videoList" width="260" rowHeight="54" automaticAdvance="true" data="{playlistTabs.selectedItem.videoDTOs}" selectOnClick="true" itemInsetV="4" itemLeading="2">

 

This implies that the videoList is getting its data from the playlistTabs.  (My suggestion worked for me because the playlistTabs.selectedItem property is bindable in the BEML, this article has more information on data binding in player templates.)  I'm guessing you want a single playlist player, right?  In that case, you wouldn't want to use playlistTabs.selectedItem.videoDTOs for your data videoList.data property (and so you can't access playlistTabs.selectedItem, unfortunately).  

 

Is using the Actionscript or Javascript APIs a possibility for you?

 

Mel

Visitor
Greg
Posts: 4
Registered: ‎01-14-2011
0 Kudos

Re: Displaying number of videos in playlist in Label

Mel,

 

You're correct, we want a single playlist player. I will take a look at the Actionscript API. Initially, we were hoping to do our players as Smart Players that would automatically swap in the HTML5 version on iPad. For that reason, I was hoping to stick to BEML. But even the customizations we're currently looking at (custom icons for the player buttons, for instance) don't appear to be supported in HTML5, so we'll probably need to create different versions anyway (one for Flash, one for HTML5).

 

If we go that route, then we might as well take advantage of Actionscript, and custom components, so that we can get things the way we want them.

 

Thanks so much for your assistance.

 

Regards,

 

Greg