Skip to content

Commit

Permalink
add versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mister-ben committed Jun 30, 2024
1 parent d3955dc commit 1589f4e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -777,14 +777,24 @@
/**
* Window location and history joined with line breaks, stringifying any objects
*
* @return string Stringified history
* @return {string} Stringified history
*/
const stringifiedLogHistory = () => {
return `${window.location.href}\n\n${document.querySelector('video-js').player.log.history().map(entryArgs => {
const player = document.querySelector('video-js').player;
const logs = [].concat(player.log.history());
const withVhs = !!player.tech(true).vhs;

return [
window.location.href,
window.navigator.userAgent,
`Video.js ${window.videojs.VERSION}`,
`Using VHS: ${withVhs}`,
withVhs ? JSON.stringify(player.tech(true).vhs.version()) : ''
].concat(logs.map(entryArgs => {
return entryArgs.map(item => {
return typeof item === 'object' ? JSON.stringify(item) : item;
});
}).join('\n')}`;
})).join('\n');
};

/**
Expand Down

0 comments on commit 1589f4e

Please sign in to comment.