1

I have a Visualforce page with a series of videos on it. I'm trying to create a filter for it, so that the videos that display on this page changes when you click and item in the filter. Everything works, except that when I re-render my "webinarBlock" page block, the actual video doesn't show and I get the "Your browser does not support the video tag" error that I added. The video does show when the page initially loads. Does anyone have any ideas on how to fix this? Here's my code:

<apex:pageBlock mode="mainDetail" id="webinarBlock">
      <apex:pageBlockSection >
           <apex:repeat id="webinars" value="{!bwList}" var="b" first="0"> 
                <apex:pageBlockSectionItem id="eachBlock">
                    <apex:outputPanel >
                        <div id="adnblogtitle" style="text-align:center">{!b.Title}</div>
                          <apex:outputPanel rendered="{!NOT(isBlank(b.Video))}" style="text-align:center; display:block;">
                               <video width="400" height="300" controls="true">
                                    <source src="{!b.Video}" type="video/mp4" />
                                        Your browser does not support the video tag.
                               </video>
                           </apex:outputPanel>
                                <br/>
                   <p style="text-align:center"><apex:outputText value="{!b.Description}" escape="false"></apex:outputText></p><br /><br /><br /><br />
                     </apex:outputPanel>
             </apex:pageBlockSectionItem>
          </apex:repeat>
       </apex:pageBlockSection>
    <div style="float:right;font-size:16px;"><apex:outputText rendered="{!bwlist2.size > 0}" value="Page 1  "/> <apex:outputLink rendered="{!bwlist2.size > 0}" value="CommunitiesWebinars2" style="text-decoration:underline">2</apex:outputLink></div><br /><br />
</apex:pageBlock>
1

The issue is with your rendered condition. Try {! LEN(b.Video)>0 && NOT(ISNULL(b.Video)) }.

You'd think ISBLANK would check if a string is blank, but the documentation states:

Determines if an expression has a value and returns TRUE if it does not. If it contains a value, this function returns FALSE.

'' is technically a value...

  • Thanks for the idea. I tried that but it still didn't work. Any other ideas? – melsherm3 Jan 27 '18 at 23:09
  • What have you tried so far? Try playing around with the rendered expression to verify it's displaying correctly. Throw a few static {'', null} in the array to make sure the condition is what you expect. – TheSFDCTower Jan 27 '18 at 23:13
1

I figured out the problem. I wasn't declaring the docType as HTML5. Once I added this to the apex page, it worked: docType="html-5.0". Thanks for the ideas!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.