I am posting this to answer two question that I had posted earlier. I do
this since I think it is good practice for those who ask to confirm if
others suggestions fix their problem or if the poster fixed the problem
thereselves.
First is a problem with creating a "progress" type animation during the
playing of media files.
To accomplish this I did the following:
Create the element (I used a <td>) as follows:
<td id="DurationTDP os" style=" text-align:center;
background-image: url(Images/Progress.png);
background-position-x: -325px;
background-repeat: repeat-y ">
The png file is 325px wide to match the length of the td. It is originally
positioned -325px to make it non-visible using the background-position-x
attribute. As the media plays you calculate the % of the media played and
move the background image accordingly.
if (WMP.controls.c urrentPosition 0)
{
currentPercent = (WMP.controls.c urrentPosition /
curItem.duratio n) * 100;
one = 325 - Math.floor(325 * (currentPercent/100));
two = '-' + one;
three = two + 'px';
currentPXString = three;
DurationTR.styl e.backgroundPos itionX =currentPXStrin g ;
}
The second problem was that when I was using a repeater I used the
ItemCreated rather than the ItemDataBound. What happened was the first time
it executed all looked fine on the page. A subsequent execution caused the
page to skip the page_load event and the button_click event such that the
data was not bound on the second execution and the ItemCreated was called
first with no e.Item.DataItem .
Changing the event fixed this problem.
Thanks
Lloyd Sheen
this since I think it is good practice for those who ask to confirm if
others suggestions fix their problem or if the poster fixed the problem
thereselves.
First is a problem with creating a "progress" type animation during the
playing of media files.
To accomplish this I did the following:
Create the element (I used a <td>) as follows:
<td id="DurationTDP os" style=" text-align:center;
background-image: url(Images/Progress.png);
background-position-x: -325px;
background-repeat: repeat-y ">
The png file is 325px wide to match the length of the td. It is originally
positioned -325px to make it non-visible using the background-position-x
attribute. As the media plays you calculate the % of the media played and
move the background image accordingly.
if (WMP.controls.c urrentPosition 0)
{
currentPercent = (WMP.controls.c urrentPosition /
curItem.duratio n) * 100;
one = 325 - Math.floor(325 * (currentPercent/100));
two = '-' + one;
three = two + 'px';
currentPXString = three;
DurationTR.styl e.backgroundPos itionX =currentPXStrin g ;
}
The second problem was that when I was using a repeater I used the
ItemCreated rather than the ItemDataBound. What happened was the first time
it executed all looked fine on the page. A subsequent execution caused the
page to skip the page_load event and the button_click event such that the
data was not bound on the second execution and the ItemCreated was called
first with no e.Item.DataItem .
Changing the event fixed this problem.
Thanks
Lloyd Sheen