Controls Not Always Showing

Posted by Community Admin on 03-Aug-2018 14:21

Controls Not Always Showing

All Replies

Posted by Community Admin on 06-Jun-2012 00:00

I am creating pages with a custom control (a video player). After I'm finished with that, I go to view the page, and the control shows up perfectly. But when I go to preview or edit the page, the control disappears.

In other words:

localhost:8080/.../video_1 works fine.
localhost:8080/.../ does not.
localhost:8080/.../Edit does not.

When the pages themselves are created, we use the fluent API, but when adding the controls, we use the standard API. (Is that the correct term?) Would that have anything to do with it?

I can provide some code upon request.

Thanks,
Chris Aumiller

Posted by Community Admin on 07-Jun-2012 00:00

Whats the code look like for the player?  The pageeditor doesn't allow javascript.  Well if you use the SF JS embed control it'll disable it in edit mode...if the JS is linked in with a plain old script tag I think itll run.

Posted by Community Admin on 07-Jun-2012 00:00

Steve,

We actually use the flowplayer if you're familiar with that.

-Chris

Posted by Community Admin on 07-Jun-2012 00:00

Yep, I've used it before

How are you linking in the flowplayer scripts in the control though?

Posted by Community Admin on 07-Jun-2012 00:00

In the InitializeControls section of the class, the following code is called:

var insertFlowPlayer = string.Format("$(document).ready(function () LB.Video.InsertFlowPlayer('0','1'););", targetId, objVideo.VideoURL);
 
// insert javascript into the startup placeholder to activate the player
var jsControl = new HtmlGenericControl("script");
jsControl.Attributes.Add("type", "text/javascript");
jsControl.InnerHtml = insertFlowPlayer;
VideoPlayerStartup.Controls.Add(jsControl);

I should mention that we hadn't seen this before we upgraded to Sitefinity 5, so that may have something to do with it.

-CA

Posted by Community Admin on 07-Jun-2012 00:00

If you open the Chrome Console or Firebug console...any javascript errors?

Posted by Community Admin on 07-Jun-2012 00:00

Will have to look... working on another project at the moment and it's one of those things I can't switch midstream.

-CA

Posted by Community Admin on 08-Jun-2012 00:00

And I looked... no javascript errors.

-CA

This thread is closed