Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Embedding Facebook video into list control not working with paginated data

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Embedding Facebook video into list control not working with paginated data

    I am developing an App that categorizes and displays Facebook (FB) videos. FB requires the placement of its javascript SDK prior to the code for the video. The pre-display code, which I have placed, in separate tests, as either a static text field or in the source code for the page on which the App resides with identical results, is:

    <div id="fb-root"></div>
    <script>(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3&appId=899807173363736";
    fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>


    An example of the code for the embedded video which is generated dynamically from the database field which holds the video URL is (note I have tried this with a static video embed code with the same issue) :

    <div class="fb-video" data-href="https://www.facebook.com/facebook/videos/10153415714906729/" data-width="500"></div>

    The issue is that the embedded FB video embeds properly for the rows of data on the first page of the list but upon loading more rows of data, the new rows do not show the video while the existing rows continue to work properly. I have tried the different pagination techniques ("auto fetch" and "fetch more" button).

    It appears that when a new "page" of data from the list is loaded, the FB Javascript code is not recognized.

    Lastly, I note that I have tried the same thing with YouTube embeded video, which does not require any pre-loaded Javascript, and it works just fine.

    I assume this has something to do with how the list loads. Is there a way to force the Javascript to load each time a page is fetched or any other solution? Thoughts on this interesting problem would be greatly appreciated.

  • #2
    Re: Embedding Facebook video into list control not working with paginated data

    Originally posted by ecalan View Post
    I assume this has something to do with how the list loads. Is there a way to force the Javascript to load each time a page is fetched or any other solution? Thoughts on this interesting problem would be greatly appreciated.
    This is not a problem with the list control or how it loads.

    The reason your videos aren't being displayed on subsequent pages is that the Facebook API is not being invoked to parse the page and embed those videos. The script they have you embed to include their API parses the entire web page and replaces all the <div> elements identified as fb-video with their respective videos when the API .js files are done loading. When the list is navigated, it doesn't call any functions in Facebook's API. You need to add the calls to invoke Facebook's parser to embed the videos.

    Check this thread over at StackOverflow.com; it should point you in the right direction or at least get you closer to the answer: http://stackoverflow.com/questions/2...video-via-ajax
    Alpha Anywhere latest pre-release

    Comment


    • #3
      Re: Embedding Facebook video into list control not working with paginated data

      Excellent. Thank you Sarah. I was thinking of the FB code as loading a reference library rather than being executed on existing HTML at runtime. This is my first foray into API. I added the simple code from from the page you suggested, FB.XFBML.parse();, to the AfterAjaxCallback event and... Done!

      Only issue remaining is that the list does not scroll on mobile devices, at least my android, when contact is made with the video and not the surrounding space. It makes the list feel broken. Any ideas for that one? I shall investigate because I believe this must be a common problem outside of Alpha.

      Thanks Again!

      Comment


      • #4
        Re: Embedding Facebook video into list control not working with paginated data

        Originally posted by ecalan View Post
        Excellent. Thank you Sarah. I was thinking of the FB code as loading a reference library rather than being executed on existing HTML at runtime. This is my first foray into API. I added the simple code from from the page you suggested, FB.XFBML.parse();, to the AfterAjaxCallback event and... Done!

        Only issue remaining is that the list does not scroll on mobile devices, at least my android, when contact is made with the video and not the surrounding space. It makes the list feel broken. Any ideas for that one? I shall investigate because I believe this must be a common problem outside of Alpha.

        Thanks Again!
        I don't know how you'd fix that. Sounds like the video is capturing all your touch events and not passing any of them up to the document. :(
        Alpha Anywhere latest pre-release

        Comment


        • #5
          Re: Embedding Facebook video into list control not working with paginated data

          You are correct, Sarah. One forum described it as video embeds "hijacking the scroll." I never noticed it with the YouTube based app I made because I actually inserted just the thumbnail image from YT in the list and then caused the video to play on click in an AA video player component. I think it looks great but it would probably be better if it scrolled with videos playing in place like Vine. I have seen some solutions but nothing perfect yet. For example, an overlay div will bring back the scroll but you can't play the video. Perhaps a click event could be placed on the overlay that passes the play command to the video? Another option would be to use the FB thumbnail the way I did with YouTube but AA's player component does not integrate directly with FB. Thoughts would be appreciated.

          Comment


          • #6
            Re: Embedding Facebook video into list control not working with paginated data

            Originally posted by ecalan View Post
            You are correct, Sarah. One forum described it as video embeds "hijacking the scroll." I never noticed it with the YouTube based app I made because I actually inserted just the thumbnail image from YT in the list and then caused the video to play on click in an AA video player component. I think it looks great but it would probably be better if it scrolled with videos playing in place like Vine. I have seen some solutions but nothing perfect yet. For example, an overlay div will bring back the scroll but you can't play the video. Perhaps a click event could be placed on the overlay that passes the play command to the video? Another option would be to use the FB thumbnail the way I did with YouTube but AA's player component does not integrate directly with FB. Thoughts would be appreciated.
            Javascript functions are just objects. If you can find the offending code, you could change it. Chrome's debugging tools will print the contents of a function to the console - assuming it's not a core JS function. Functions have a method, toString, you can call to print the function's code. EG:

            Code:
            alert({dialog.object}.getValue.toString());
            If you wanted to redefine the function definition for a function:

            Code:
            {dialog.object}.getValue = function () {
              alert("Error: Don't re-define methods in {dialog.object}. It's a horrible idea.");
              return undefined;
            }
            Alpha Anywhere latest pre-release

            Comment


            • #7
              Re: Embedding Facebook video into list control not working with paginated data

              It's also possible that adding an event listener (see $e.add) on the touch events to capture those scroll/pan/whatever events and passing them through to the browser somehow might work. I'm not as well versed in event propagation as I could be, but maybe a separate event listener can circumvent the issue --- probably a idea than hacking Facebook's javascript to bend to your will.
              Alpha Anywhere latest pre-release

              Comment


              • #8
                Re: Embedding Facebook video into list control not working with paginated data

                The above two posts are, of course, probably the worst road to travel. You may be able to do it with a simple overlay around the video element: http://stackoverflow.com/questions/7...be-flash-video
                Alpha Anywhere latest pre-release

                Comment

                Working...
                X