Alpha Video Training
Results 1 to 14 of 14

Thread: Wont Play Video In PhoneGap App

  1. #1
    Member
    Real Name
    Steven
    Join Date
    Oct 2011
    Posts
    633

    Default Wont Play Video In PhoneGap App

    I have a phonegap built ios mobile app that when someone clicks on a picture it should play a video. So in a video player component, it should set the url from one that is pulled from a sql table. It works fine when I publish the app and access it through a web browser. It doesn't work through the phonegap built app. It opens up the video player window but doesn't play the video. I checked and the player and app has always allowed for security. Any suggestions?

  2. #2
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,551

    Default Re: Wont Play Video In PhoneGap App

    There are 4 Video Player controls within Alpha. Which one are you using... which section did you get it from?

    What is the "picture" rendered in... a static image, data bound control, List, ViewBox, FormView?

    What version/build of Alpha are you working with?

  3. #3
    Member
    Real Name
    Steven
    Join Date
    Oct 2011
    Posts
    633

    Default Re: Wont Play Video In PhoneGap App

    The video player is the one under web components. The picture is a image control that pulls a path in a sql table that points to the image to display, so I am assuming it is a data bound control... Using build 4346_4889

  4. #4
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,551

    Default Re: Wont Play Video In PhoneGap App

    Sorry... you did say component. So that's 4 controls and 1 component.

    How are you running the Video Player Component in your UX?

    If the Image control is data bound, I doubt it's bound to the table character field your URL is found in.

    What type of video are you trying to play? Can you post a sample URL here?

    Is your PGB app iOS, Android, or both? Have your tried both?

  5. #5
    Member
    Real Name
    Steven
    Join Date
    Oct 2011
    Posts
    633

    Default Re: Wont Play Video In PhoneGap App

    When a user clicks on the image then the onclick action in a list control pulls up and should pull the url for the video to play. The videos are stored in Amazon S3 and the urls do play the video in the web browser as stated before. All the videos are mp4 format. Again, I am not sure why they play fine in the web browser but not the phonegap built app. I have just tested for IOS.

  6. #6
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,551

    Default Re: Wont Play Video In PhoneGap App

    Ok... so we're working with a List control as well. But how is the Video Component being accessed? What is the onClick event of the List control actually doing? Is it running the Action Javascript "Open a Video Player Component"? If so, how is that action defined? What is the Target? The Video Player Component is usually bound, via an Argument, to a UX Control. Is that your List control?

  7. #7
    Member
    Real Name
    Steven
    Join Date
    Oct 2011
    Posts
    633

    Default Re: Wont Play Video In PhoneGap App

    Yes it is an action javascript "Open a Video Player Component. Target is a window. The mp4 argument value is bound to the sql table and field that holds the url to play. Hopes this answers your questions. Is there a certain player I should be choosing in the video player component, perhaps JWPlayer?

  8. #8
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,551

    Default Re: Wont Play Video In PhoneGap App

    Ok... getting closer... but you're going to have to explain this one...

    The mp4 argument value is bound to the sql table and field that holds the url to play
    Your List control has a SQL data source. So... it's one of 2 bindings for your Player Video Component:

    1. Your List does not have a Detail View and the List Return Value Type is set to a field... and that field is your SQL URL field... and your Video Player Component is bound to the List.
    2. Your List has a Detail View and your Video Player Component is bound to the Detail View Textbox control holding your URL

    JW_Player is an option for a Flash Player. What is your Video Component HTML5 / Flash Player Type set to?

    Flash does not have native support under iOS. But your videos are mp4... so the Flash Player doesn't matter... this is all HTML5 stuff.
    Last edited by Davidk; 05-29-2017 at 07:59 PM.

  9. #9
    Member
    Real Name
    Steven
    Join Date
    Oct 2011
    Posts
    633

    Default Re: Wont Play Video In PhoneGap App

    I don't have a detail view and the return value is set to a field and the field is my sql url field. Not sure about the bound video player component, where do I check that?

  10. #10
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,551

    Default Re: Wont Play Video In PhoneGap App

    I followed this through because I wanted to see if the Video Component could be used in a PGB app. I don't think it can be. The app is attempting to load the Video Component from the device file system, for whatever reason. The rendered app is showing a 404 error on trying to find the Video Component. You might be able to put the Video Component into a UX and call that but now it just going from bad to worse.

    However, I don't think you want to use that component anyway. Not to take anything away from it... but it's fairly old... and designed for use with Web Apps before PGB apps were in play within Alpha.

    The control you want to use is Data Controls, More, VideoPlayer. This is a standard data control and therefore you can set it's video source with a .setValue() method. And... it's designed for use with PGB.

    In your List control onClick event...

    Code:
    {dialog.Object}.setValue('videoPlayer',this.value[0]);
    {dialog.object}.panelSetActive('PANELCARD_2',true);
    I've got my VideoPlayer Control in a PanelCard so here I'm setting the value of the VideoPlayer to this.value[0] because my List is set to return the URL column and then changing to my Panel.

    If you really want your pop-up window, then put the VideoPlayer in a Container:Window control and pop that up.

  11. #11
    Member
    Real Name
    Steven
    Join Date
    Oct 2011
    Posts
    633

    Default Re: Wont Play Video In PhoneGap App

    Seems to be working, one odd thing, after it moves to the video player panel card and move back to the previous panel card, it wont let me scroll down it just goes back to the video player panel card. Its almost like it is reading it as onclick, instead of trying to scroll

  12. #12
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,551

    Default Re: Wont Play Video In PhoneGap App

    It's the touch scrolling that is setting off the onClick. That's why, most of the time, a button is placed in the list with "Stop event propagation" and "Focus row" turned on. The button onClick event will fire off the video process.

  13. #13
    Member
    Real Name
    Steven
    Join Date
    Oct 2011
    Posts
    633

    Default Re: Wont Play Video In PhoneGap App

    Sorry, so I need to add something to the onclick event within the play video event?

  14. #14
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,551

    Default Re: Wont Play Video In PhoneGap App

    Nope. It's easy to tap/click on a row without meaning to do it. You don't want to launch a video because of this. So, in the List Fields tab, click "Add Item" and add a button. The onClick event of your new button will fire off the video process. You can comment out the video stuff in the List onClick event.

    When you add the button in List Fields, you'll see it has a couple of properties... Stop event propagation and Focus row. Turn them on. You may not need them, but... nice to have on.

    Now add your new Button to your List Layout. Now you can scroll through your List... and when ready to view a video, tap on the Button which is displayed on each row of your List.

    The code in your Button onClick Event will be a bit different than the code in your List onClick Event...

    Code:
    {dialog.Object}.setValue('videoPlayer',data.videoURL);
    {dialog.object}.panelSetActive('PANELCARD_2',true);
    Before we could use "this" which was the List object. However, now we have to use "data" which is passed into the Button event and represents the row of List data. So... data.videoURL is the column representing the URL field in your List.

Similar Threads

  1. Control Bar Wont Show After Building In Phonegap
    By swest in forum Mobile & Browser Applications
    Replies: 5
    Last Post: 01-26-2017, 10:18 PM
  2. Video Player Won't Play
    By citorlfl in forum Application Server Version 11 - Web/Browser Applications
    Replies: 0
    Last Post: 09-04-2012, 02:26 PM
  3. Play Windows Media Video from a grid
    By cezar in forum Application Server Version 11 - Web/Browser Applications
    Replies: 3
    Last Post: 03-07-2012, 03:02 PM
  4. Play video in detail view.
    By leetv in forum Application Server Version 10 - Web/Browser Applications
    Replies: 1
    Last Post: 07-19-2011, 12:28 AM
  5. Play Video on Startup
    By David Boomer in forum Alpha Five Version 8
    Replies: 1
    Last Post: 04-03-2008, 12:36 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •