This module provides a robust frontend view of all videos for summit presentations, allowing filtering by summit, speaker, search, and featured/latest videos, with passive pushes from the server to the client.
framework/sake dev/build flush=1
It is also critical to run a migration task to populate the PresentationVideo table and infill all of the legacy Presentation records that were not created for early summits.
framework/sake dev/tasks/VideoPresentationMigration
- Create a
SummitVideoApppage somewhere in the SiteTree, and title the page appropriately (e.g./summit/videos) - In the Summit Videos admin tab, choose one video to be featured by clicking the "Set as Featured" button on its edit form.
- Select a few videos to be highlighted by checking their "highlighed" checkbox
There are several configurable settings made available to the developer to tailor the user experience.
In summit-video-app/_config/config.yml:
| Setting name | Description | Default value |
|---|---|---|
| default_speaker_limit | Number of speakers returned by default | 20 |
| popular_video_limit | Number of popular videos | 10 |
| video_poll_interval | Frequency, in milliseconds, that the app passively refreshes state | 15000 |
| video_view_staleness | How old, in seconds, a video has to be before it will ask YouTube for its up-to-date view count | 3600 |
| abandon_unprocessed_videos_after | How long a video has to be stuck in "processing" before the task forgets about it and stops trying | 86400 |
There are two cron tasks that should be run at short intervals:
SummitVideoProcessingTask: Checks all videos marked "processing" and gets their current status from YouTube, updating them to "processed" if appropriate. Unprocessed videos are hidden from the site.SummitVideoViewTask: Gets the most popular videos from YouTube and updates their view count in the local database. This is to maintain an accurate "popular videos" section.
This module should deprecate the VideoPresentation table.
- Run
$ npm installin thesource/directory - Run
$ npm run serve summit-video-appin the webroot to start the Webpack dev server
In dev mode, the Javascript and CSS assets will be loaded from the local webpack dev server instead of the web server. This provides hot reloads of CSS and Javascript, meaning most of the time, reloading the browser is unnecessary. Further, changes to React components will hot reload in the browser and persist their state.
The determination to use the dev server is based on the outcome of the $WebpackDevServer template accessor.
All assets that will be shipped to production, including images, need to be declared in index.js, which serves as a manifest the production build. Ideally, the source/ folder should not be deployed to production.
To run a production build:
npm run build summit-video-app
Client side tests for Redux stores, reducers, and actions:
npm run test
Integration and unit tests for PresentationVideo, SummitVideoApp_Controller, and the two tasks
framework/sake dev/tests/SummitVideoAppTest
framework/sake dev/tests/SummitVideoTasksTest
All video result sets are limited to default_video_limit in the config (50).
Provides all videos, across all summits, ordered by DateUploaded DESC.
Optional parameters:
?group=highlighted: Shows only videos marked highlighted?group=popular: Shows popular videos (Views DESC). Filtered bypopular_video_view_thresholdin the config.
Example response:
{
"summit":null,
"speaker":null,
"results":[
{
"id":1533,
"title":"Video 1",
...
}
]
}Searches video titles, speakers, topics (categories) and summits for keywords, and provides 4 separate result sets.
Example response
{
results: {
titleMatches: [
{
"id":1533,
"title":"Video 1",
...
}
],
speakerMatches: [
{
"id":1534,
"title":"Video 2",
...
}
],
topicMatches: [
{
"id":1535,
"title":"Video 3",
...
}
],
summitMatches: [
{
"id":1535,
"title":"Video 3",
...
}
]
}
}Gets the videos for a speaker with given ID.
Example response:
{
"summit": null,
"speaker": {
"id": 123,
"name": "Uncle Cheese"
},
"results":[
{
"id":1533,
"title":"Video 1",
...
}
]
}Gets the videos for a summit with given SLUG.
Example response:
{
"summit": {
"id": 123,
"title": "Paris"
},
"speaker": null,
"results": [
{
"id":1533,
"title":"Video 1",
...
}
]
}
Gets the videos for a given tag.
Example response:
{
"tag": {
"id": 123,
"tag": "Nova"
},
"speaker": null,
"results": [
{
"id":1533,
"title":"Video 1",
...
}
]
}
Gets the videos for a track with given SLUG and a summit slug.
Example response:
{
"track": {
"id": 123,
"slug": "cloudfunding",
"title": "CloudFunding"
},
"speaker": null,
"results": [
{
"id":1533,
"title":"Video 1",
...
}
]
}
Example response:
{
"id":1533,
"title":"Video 1",
...
}Gets the latest uploaded video.
Gets the featured video
Example response:
{
"id":1533,
"title":"Video 1",
...
}Gets a video with given ID.
Example response:
{
"id":1533,
"title":"Video 1",
...
}Gets all of the summits
Example response
{
"results":[
{
"id":5,
"title":"Tokyo",
"dates":"Oct 26 - 29, 2015",
"videoCount":"327",
"imageURL":"http:\/\/placehold.it\/200x100"
},
{
...
}
]
}Gets a list of the speakers, ordered by most aggregate videos, descending. Limited by default_speaker_limit in the config (20).
Example response:
{
"results":[
{
"id":1,
"name":"Speaker 1",
"jobTitle":"Chief Technologist",
"imageURL":"http:\/\/placehold.it\/200x100",
"videoCount":"23"
},
{
...
}
}