[−][src]Function proj17_iot_server::endpoints::videos_endpoints::get_video
pub fn get_video(
display_id: i32
) -> Result<JsonValue, Option<BadRequest<JsonValue>>>
Get the most appropriate video to play on the screen of specified id Appropriateness depends on the trackers currently registered to the reciver, and their interests
Appropriateness is calculated as follows:
1: Get all the videos that match the interest(s) present at the display location.
2: Filter the results based on which videos have credits left to use
3: Find the highest weighted interest in the filtered results
4: Filter away the videos which have other interest
5: Shuffle the results and return the first video in the shuffled list
Responds with:
200: if the tracker and receiver exist.
Response body:
{message: "video found", video :{"length": <video_length_seconds>, order: <associated_order>, url :<video_url>, <videoId>: <video_identifier>}}
404: if the display does not exist
This is an API endpoint mapped to
- /video/<display_id> [GET]
Arguments
url parameters:
display_id- the id of the display to get video for.