Commit 1e2ebda8 authored by Martin Santangelo's avatar Martin Santangelo

(fix) can't play videos on comments

parent 47613deb
......@@ -13,6 +13,9 @@ import api from '../common/services/api.service';
export default class CommentModel extends ActivityModel {
@observable expanded = false;
entity_guid: string = '';
attachments?: {
attachment_guid: string;
};
/**
* Store for child comments
......
......@@ -293,7 +293,10 @@ class MindsVideo extends Component<PropsType, StateType> {
if (!this.state.sources && this.props.entity) {
const response: any = await attachmentService.getVideoSources(
this.props.entity.entity_guid || this.props.entity.guid,
this.props.entity.attachments &&
this.props.entity.attachments.attachment_guid
? this.props.entity.attachments.attachment_guid
: this.props.entity.entity_guid || this.props.entity.guid,
);
state.sources = response.sources.filter((v) => v.type === 'video/mp4');
......@@ -304,6 +307,8 @@ class MindsVideo extends Component<PropsType, StateType> {
headers: apiService.buildHeaders(),
};
}
} else {
console.log('NO SOURCES!');
}
this.setState(state);
......
......@@ -43,7 +43,6 @@ export default class ActivityModel extends BaseModel {
'comments:count': number;
'thumbs:down:user_guids': Array<number>;
'thumbs:up:user_guids': Array<number>;
rowKey?: string;
containerObj?: GroupModel;
remind_object?: ActivityModel;
......@@ -72,6 +71,9 @@ export default class ActivityModel extends BaseModel {
min: number;
} | null;
_preview?: boolean;
attachments?: {
attachment_guid: string;
};
/**
* Mature visibility flag
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment