Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

How does slideshow work?
Croydon
#1 Posted : Thursday, 16 April 2009 7:44:00 PM(UTC)
Rank: Newbie

Joined: 16/04/2009(UTC)
Posts: 3
Location: UK

Hi,

Would it be possible to get some advice about how the slideshow work?

I would like to step through the code in debug mode but not sure where to put the break point in mediaobjectview.ascs.cs?

Thanks
Roger Martin
#2 Posted : Thursday, 16 April 2009 11:53:36 PM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,167
Location: Fort Atkinson, WI

The slide show uses javascript to make an AJAX request for information about the next media object and then it displays it when the timer ticks. The key javascript function is showNextMediaObject in the script file gs\script\mediaobjectview.js. This function displays the next item in the album and then at the end calls a web service named GetMediaObjectHtml (located in gs\services\Gallery.asmx.cs) to pre-load the information about the next item.

So the breakpoints you'll want to set will be in javascript and/or the web service method.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
Croydon
#3 Posted : Monday, 20 April 2009 7:20:31 PM(UTC)
Rank: Newbie

Joined: 16/04/2009(UTC)
Posts: 3
Location: UK

Thanks for your reply, that is very helpful.

Would it be possible to give some advice about how the silverlight is used in the application?

What are the SilverlightControl.js and SilverlightMedia.js files doing in the application? Are they provided by Microsoft?

In addition, what is the different between htmOutput and scriptOutput? When I check the output in debugg mode, they looks the same.

Thanks
Roger Martin
#4 Posted : Monday, 20 April 2009 11:52:26 PM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,167
Location: Fort Atkinson, WI

SilverlightControl.js and SilverlightMedia.js are provided by MS. They are required for playing video and audio with Silverlight.

htmlOutput is a variable that holds the HTML for a media object. For an image, it will consist of the <img ... /> tag. For some types of video and audio (depending on how the HTML template is configured in galleryserverpro.config), it will be an <object ... /> tag.

As you navigate back and forth between objects in an album, the htmlOutput variable is populated via an AJAX request. To render the next (or previous) object, javascript replaces the old HTML in the DOM with the new HTML stored in htmlOutput. That causes the new media object to appear.

scriptOutput contains javascript that must be executed to help render a media object. I had to add this variable to support Silverlight because Silverlight requires a combination of HTML, XAML, and javascript.

For non-Silverlight objects, the scriptOutput variable will be empty. I don't think htmlOutput and scriptOutput should ever contain the same value.

Hope this helps,
Roger Martin
Creator and Lead Developer of Gallery Server Pro
Croydon
#5 Posted : Tuesday, 21 April 2009 9:09:08 PM(UTC)
Rank: Newbie

Joined: 16/04/2009(UTC)
Posts: 3
Location: UK

Regarding the code in the mediaobjectview.js

Code:
//listComponents();
    Array.forEach(_mediaObjectsToDispose, disposeAjaxObject);
    Array.clear(_mediaObjectsToDispose);
    //listComponents();


I can see _mediaObjectsToDispose is declared at the top but can not find where the values are assigned to it.
Am I missing something?

I also tried to test the animation in the same script file
Code:
var moImg = $get('mo_img');
if (moImg) {
moImg.src = _moCacheImg.src;
if (_fadeInMoAnimation) {
_fadeInMoAnimation.set_target(moImg);
_fadeInMoAnimation.play();
}
}


but after showing about 6 pictures slideshow, got a javascript runtime error saying "Member not Found". When I choose to debug and the line
Code:
if (element.filters)
are located in the ajax controltoolkit runtime source file.



Thanks for your kind help.
Roger Martin
#6 Posted : Wednesday, 22 April 2009 12:12:17 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,167
Location: Fort Atkinson, WI

If you look carefully at the scriptOutput template defined for Silverlight media files (e.g. wma, wmv, mp3) in galleryserverpro.config, you will see this line:

Array.add(_mediaObjectsToDispose, &quot;mp1&quot;);

That adds the Silverlight object to the array, which is then disposed by the code you cited.

I'm not sure what your dev environment is like, but if you are using Visual Studio you can use a global find function to find all instances of _mediaObjectsToDispose in the project - that would have helped you.

I am not sure what is going on with the animation. I haven't seen that error before. Sorry.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
Rss Feed  Atom Feed
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.