Page 1 of 2

Store video and permit certain signed-in users to access it, but deny others

Posted: Fri Nov 15, 2013 5:54 am
by Doz

Hi!

I am developing an app. I have created sign-up and sign-in services which are working fine.

1) Where can I store some videos that can be assessed through the video control?

2) When a user signs in, I need him to be directed to a page which contains a video screen. When he clicks on the video screen, any video which he has the permission to view should start playing. How do I grant permission to certain signed-in users to view a video but not others?.
For example,
User_1 can view Video_12, but cannot view other videos.
User_2 can view Video_5, but cannot view other videos (you get the point)?

Please, give me a sense of how to approach the above 2 challenges.

Thank you.


Store video and permit certain signed-in users to access it, but deny others

Posted: Fri Nov 15, 2013 8:10 am
by Kateryna Grynko

Hi,

You can store video in Database: http://docs.appery.io/tutorials/uploa...
There are no access settings for a database file. Please create a database collection where you can store a file URL and a flag field showing if you can read being unregistered.


Store video and permit certain signed-in users to access it, but deny others

Posted: Sat Nov 16, 2013 7:04 pm
by Doz

The tutorial which Katya referred me to above deals with image files. It does not work for retrieving uploaded video files.

  • What request and response parameters can I use to retrieve a video file from the database?

  • How do I map these parameters?

    Thanks.


Store video and permit certain signed-in users to access it, but deny others

Posted: Sat Nov 16, 2013 7:13 pm
by Alena Prykhodko

Hello Doz!

Please check this doc http://docs.appery.io/documentation/b...


Store video and permit certain signed-in users to access it, but deny others

Posted: Sat Nov 16, 2013 7:44 pm
by Doz

Hi Alena,

I already tried retrieving it that way but it did not work. I suspect that my mapping may be faulty. I entered the database_id manually in the request.

For the session token, I mapped it from local storage to the request. Is there a problem with this?

Also let me know what to map in the response.

Thank you.


Store video and permit certain signed-in users to access it, but deny others

Posted: Sat Nov 16, 2013 8:54 pm
by Alena Prykhodko

Is your project shared with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a?
Please share, tell its name and where to see the problem.


Store video and permit certain signed-in users to access it, but deny others

Posted: Sat Nov 16, 2013 9:42 pm
by Doz

It is shared. App name is Cons-1. I created a REST service called user_video. I am trying to invoke it by clicking on the video screen on the startScreen page.


Store video and permit certain signed-in users to access it, but deny others

Posted: Sun Nov 17, 2013 9:23 am
by Alena Prykhodko

What video type do you use? Please specify it in Service setting, now you have only file name.


Store video and permit certain signed-in users to access it, but deny others

Posted: Mon Nov 18, 2013 12:12 am
by Doz

It is mp4. Currently, I have changed the video file to another one which has the extension .mp4. When I open the test page, I can hear the video playing but I cannot see anything. I need the video to play in the video window. How do I achieve this? Also, why does it start to play automatically even though I invoked the service on video icon click?


Store video and permit certain signed-in users to access it, but deny others

Posted: Mon Nov 18, 2013 8:01 pm
by Kateryna Grynko

Hi,

Your file "JavaScript1" doesn't contain JavaSrcipt, but contains HTML code. This is incorrect. Please delete it.