Skip to content

Commit

Permalink
Fixclient (#392)
Browse files Browse the repository at this point in the history
* fix simple client video, newapi, hangup
  • Loading branch information
olofkallander authored Jan 11, 2025
1 parent b6af4db commit 4f11ef2
Show file tree
Hide file tree
Showing 13 changed files with 3,353 additions and 6,792 deletions.
3 changes: 2 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ responsible for allocating and configuring SMB resources. Simpleclient acts as t
These projects are limited in their use cases and are only meant for documentation and testing purposes.

## Building
Make sure SMb has been built with legacy_api off

### Simpleserver

Expand All @@ -25,7 +26,7 @@ Simpleserver is a java project requiring maven and openjdk 11 or later.

1. Start SMB.
2. Start simpleserver.
3. Open two or more tabs in Chrome with simpleclient/dist/index.html
3. Open two or more tabs in Chrome with localhost:3000
4. Make sure the simpleserver instance at https://localhost:8081/ is accessible from Chrome. You might have to add an exception for the self-signed certificate of simpleserver.
5. Click 'join' in the simpleclient instances.

Expand Down
63 changes: 37 additions & 26 deletions examples/simpleclient/gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
var gulp = require("gulp");
var gulp = require("gulp"), connect = require('gulp-connect');
var browserify = require("browserify");
var source = require("vinyl-source-stream");
var source = require("vinyl-source-stream"), buffer = require('vinyl-buffer');
var watchify = require("watchify");
var tsify = require("tsify");
var fancy_log = require("fancy-log");
var paths = {
pages: ["src/*.html"],
};
var watchedBrowserify = watchify(
browserify({
basedir: ".",
debug: true,
entries: ["src/main.ts", "src/simulcast.ts"],
cache: {},
packageCache: {},
}).plugin(tsify)
);
gulp.task("copy-html", function () {
return gulp.src(paths.pages).pipe(gulp.dest("dist"));
});
function bundle() {
return watchedBrowserify
.bundle()
.on("error", fancy_log)
.pipe(source("bundle.js"))
.pipe(gulp.dest("dist"));
var sourcemaps = require('gulp-sourcemaps');

var customOpts = {entries : [ "src/*.html", "src/*.ts" ], debug : true};

var b = watchify(browserify({
basedir : ".",
debug : true,
entries : [ "src/main.ts", "src/simulcast.ts" ],
cache : {},
packageCache : {},
}).plugin(tsify));

gulp.task('js', bundle); // so you can run `gulp js` to build the file
b.on('update', bundle); // on any dep update, runs the bundler
b.on('log', fancy_log.info); // output build logs to terminal

gulp.task("copy-html", function() { return gulp.src(customOpts.entries).pipe(gulp.dest("dist")); });
gulp.task('connect', function() { connect.server({root : 'dist', livereload : true, port : 3000}); });

gulp.task('default', gulp.series('js', 'copy-html', 'connect'));

function bundle()
{
return b
.bundle()
// log errors if they happen
.on('error', fancy_log.error.bind(fancy_log, 'Browserify Error'))
.pipe(source('bundle.js'))
// optional, remove if you don't need to buffer file contents
.pipe(buffer())
// optional, remove if you dont want sourcemaps
.pipe(sourcemaps.init({loadMaps : true})) // loads map from browserify file
// Add transformation tasks to the pipeline here.
.pipe(sourcemaps.write('./')) // writes .map file
.pipe(gulp.dest('./dist'));
}
gulp.task("default", gulp.series(gulp.parallel("copy-html"), bundle));
watchedBrowserify.on("update", bundle);
watchedBrowserify.on("log", fancy_log);
Loading

0 comments on commit 4f11ef2

Please sign in to comment.