mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-12-12 23:02:30 -05:00
feat: Video Trimmer and more
This commit is contained in:
@@ -180,16 +180,13 @@ export default function ViewerInfoContent(props) {
|
||||
let split = match.split(':'),
|
||||
s = 0,
|
||||
m = 1;
|
||||
let searchParameters = new URLSearchParams(window.location.search);
|
||||
|
||||
while (split.length > 0) {
|
||||
s += m * parseInt(split.pop(), 10);
|
||||
m *= 60;
|
||||
}
|
||||
searchParameters.set('t', s);
|
||||
|
||||
const wrapped =
|
||||
'<a href="' + MediaPageStore.get('media-url').split('?')[0] + '?' + searchParameters + '">' + match + '</a>';
|
||||
const wrapped = `<a href="#" data-timestamp="${s}" class="video-timestamp">${match}</a>`;
|
||||
return wrapped;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ export default class ViewerSidebar extends React.PureComponent {
|
||||
isPlaylistPage: !!props.playlistData,
|
||||
activeItem: 0,
|
||||
mediaType: MediaPageStore.get('media-type'),
|
||||
chapters: MediaPageStore.get('media-data')?.chapters
|
||||
};
|
||||
|
||||
if (props.playlistData) {
|
||||
@@ -37,6 +38,7 @@ export default class ViewerSidebar extends React.PureComponent {
|
||||
onMediaLoad() {
|
||||
this.setState({
|
||||
mediaType: MediaPageStore.get('media-type'),
|
||||
chapters: MediaPageStore.get('media-data')?.chapter_data || []
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user