Skip to content

Commit

Permalink
chore(version): add version constant in bundle to replace util.version
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjammet committed Mar 4, 2024
1 parent 7fcaac8 commit 13aef9d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/player.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ <h3 class="text-center">WebRTC Client Player Example</h3>
<script src="https://cdn.jsdelivr.net/npm/webrtc-adapter/out/adapter.js"></script>
<script type="module">
import { NetAddress, Util } from "https://cdn.jsdelivr.net/npm/@ceeblue/web-utils@1.1.0/dist/web-utils.min.js";
import { Player, HTTPConnector, WSController } from "../dist/webrtc-client.min.js";
import { Player, HTTPConnector, WSController, VERSION } from "../dist/webrtc-client.min.js";
// development version, includes helpful console warnings
// import { createApp } from 'https://cdn.jsdelivr.net/npm/vue@3/dist/vue.esm-browser.js';
// production version, optimized for size and speed
import { createApp } from 'https://cdn.jsdelivr.net/npm/vue@3/dist/vue.esm-browser.prod.js';
console.log('webrtc-client version:', Util.VERSION);
console.log('webrtc-client version:', VERSION);

const PlayState = {
PLAYING: 'PLAYING',
Expand Down
4 changes: 2 additions & 2 deletions examples/streamer.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ <h4 class="text-center font-weight-bold">On Air</h4>
<script src="https://cdn.jsdelivr.net/npm/webrtc-adapter/out/adapter.js"></script>
<script type="module">
import { NetAddress, Util } from "https://cdn.jsdelivr.net/npm/@ceeblue/web-utils@1.1.0/dist/web-utils.min.js";
import { Streamer, HTTPConnector, WSController } from "../dist/webrtc-client.js";
console.log('webrtc-client version:', Util.VERSION);
import { Streamer, HTTPConnector, WSController, VERSION } from "../dist/webrtc-client.js";
console.log('webrtc-client version:', VERSION);

const DEFAULT_STREAMING_BITRATE = 3000000;
const DEFAULT_STREAMING_WIDTH = 1280;
Expand Down
4 changes: 4 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ export { StreamMetadata } from './src/metadata/StreamMetadata';
// Timed metadata
export { IStreamData } from './src/metadata/IStreamData';
export { WSStreamData } from './src/metadata/WSStreamData';

const __lib__version__ = '?'; // will be replaced on building by project version

export const VERSION: string = __lib__version__;

0 comments on commit 13aef9d

Please sign in to comment.