| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- import { Model, Collection } from 'js-abstract-model'
- class PlayerSource extends Model {
- constructor (data) {
- super(data, [
- {
- key: 'src',
- default: ''
- },
- {
- key: 'type',
- default: 'video/mp4'
- },
- {
- key: 'label',
- default: ''
- },
- {
- key: 'caption',
- default: ''
- },
- {
- key: 'link',
- default: ''
- },
- {
- key: 'res',
- default: ''
- },
- {
- key: 'selected',
- default: false
- }
- ])
- if (!this.label && this.res) {
- this.label = this.res
- }
- if (!this.src && this.link) {
- this.src = this.link
- }
- }
- }
- class PlayerSourceList extends Collection {
- model () {
- return PlayerSource
- }
- }
- export { PlayerSource, PlayerSourceList }
|