M-Anwar / ARGEL

ARGEL Marketing Solutions
3 stars 1 forks source link

Front End - Picture Continuous Play #11

Closed M-Anwar closed 8 years ago

M-Anwar commented 8 years ago

There is a problem with continuous play when picture ads are displayed. It takes pictures way too quickly and does not show the ad for 10 seconds. It seems to take 2 pictures at once then delay for some time (not 10 seconds), and then take 2 pictures again. I am uncertain of the behavior of video ads, but we need to ensure that any combination of ads (picture video, video video, picture picture) all follow the correct continuous play logic.

Also there is an issue when no ads are returned, the continuous play stops and does not take a picture at a later time. The behavior should be, if no ads are returned, play the next ad in the queue, and if the queue is exhausted, repeat the current ad again, but at the next cycle, attempt to take another picture. Right now no attempt is made to take another picture, and the continuous play simply stops.

Again to clarify the role of the client in continuous play, I have outlined the suggested behavior:

  1. Initialize previousAdList = [], recommendedAdQueue=[]
  2. On begin capture button, request a list of ads from server
  3. When server returns the list, there are 2 possibilities:
    1. If the list of returned ads is empty, don't update the recommendedAdQueue
    2. If it is not empty, clear the recommendedAdQueue and add advertisements who's ids are not already in the previousAdList
  4. Pop an ad from the recommendedAdQueue and show the ad. Also add the shown advertisement to the previousAdList. Note: the size of the previousAdList should be smaller then the amount of ads returned by the server.
  5. After the ad has been shown ensure that a future call to fetch ads from the server is queued at the right time if the user wants to keep continuously showing ads.