Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dash 4.5.2, HLS 1.2.9 working with Virtual Channel #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions uapi/bin/uapi.js

Large diffs are not rendered by default.

28 changes: 22 additions & 6 deletions uapi/res/players/DashJs.hx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Argan;
class DashJs {
//static function __init__() untyped {}
static var v3:Bool = false;
static var v4:Bool = false;
static function main() untyped {
var title:String = Reflect.field(Browser.window, "title");
if(title.indexOf(untyped dashjs.Version) == -1)
Expand All @@ -13,6 +14,7 @@ class DashJs {
// dash.js v3.0.0 has new configuration logic
// https://github.com/Dash-Industry-Forum/dash.js/blob/HEAD/docs/migration/Migration-3.0.md
v3 = untyped StringTools.startsWith(dashjs.Version, "3.");
v4 = untyped StringTools.startsWith(dashjs.Version, "4.");

window.help = function(){
return Argan.help(true);
Expand Down Expand Up @@ -50,14 +52,18 @@ class DashJs {
try{
//player.setSegmentOverlapToleranceTime(Argan.get("setSegmentOverlapToleranceTime","Segment overlap tolorance threshold", 4));
var jumpGaps = Argan.get("setJumpGaps","setJumpGaps", true);
v3 ?
v3?
player.updateSettings(cfg("streaming.jumpGaps", jumpGaps)) :
player.setJumpGaps(jumpGaps);
if (!v4) {
player.setJumpGaps(jumpGaps);
}

var lowLatencyEnabled = Argan.get("setLowLatencyEnabled","setLowLatencyEnabled", false);
v3 ?
player.updateSettings(cfg("streaming.lowLatencyEnabled", lowLatencyEnabled)) :
player.setLowLatencyEnabled(lowLatencyEnabled);
if (!v4) {
player.setLowLatencyEnabled(lowLatencyEnabled);
}

if(Argan.has("setLiveDelay")){
var liveDelay = Argan.get("setLiveDelay", "setLiveDelay", 10.0);
Expand All @@ -76,13 +82,23 @@ class DashJs {
}

var onStreamInitialized = function (e) {
player.setTrackSwitchModeFor('video', 'alwaysReplace');
player.setTrackSwitchModeFor('audio', 'alwaysReplace');

if (v3 && !v4) {
player.updateSettings(cfg("streaming.trackSwitchMode.video", "alwaysReplace"));
player.updateSettings(cfg("streaming.trackSwitchMode.audio", "alwaysReplace"));
}

if (v3){
player.setTrackSwitchModeFor('video', 'alwaysReplace');
player.setTrackSwitchModeFor('audio', 'alwaysReplace');
}

var fastSwitch = Argan.get("setFastSwitchEnabled","setFastSwitchEnabled", true);
v3 ?
player.updateSettings({ streaming: {fastSwitchEnabled: fastSwitch}}) :
player.setFastSwitchEnabled(fastSwitch);
if (!v4){
player.setFastSwitchEnabled(fastSwitch);
}

clearMenu();

Expand Down
2 changes: 1 addition & 1 deletion uapi/res/players/Shaka.hx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Shaka {
player.configure({
streaming: {
smallGapLimit: Argan.getDefault("smallGapLimit","config.streaming.smallGapLimit", .5),
jumpLargeGaps: Argan.getDefault("jumpLargeGaps","config.streaming.jumpLargeGaps", false)
jumpLargeGaps: Argan.getDefault("jumpLargeGaps","config.streaming.jumpLargeGaps", true)
},
drm: {
servers: {
Expand Down
5 changes: 5 additions & 0 deletions uapi/res/players/dashjs.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"4.5.2": ["https://cdnjs.cloudflare.com/ajax/libs/dashjs/4.5.2/dash.all.debug.js"],
"4.5.1": ["https://cdnjs.cloudflare.com/ajax/libs/dashjs/4.5.1/dash.all.debug.js"],
"4.5.0": ["https://cdnjs.cloudflare.com/ajax/libs/dashjs/4.5.0/dash.all.debug.js"],
"4.4.1": ["https://cdnjs.cloudflare.com/ajax/libs/dashjs/4.4.1/dash.all.debug.js"],
"4.4.0": ["https://cdnjs.cloudflare.com/ajax/libs/dashjs/4.4.0/dash.all.debug.js"],
"4.3.0": ["https://cdnjs.cloudflare.com/ajax/libs/dashjs/4.3.0/dash.all.debug.js"],
"4.2.0": ["https://cdnjs.cloudflare.com/ajax/libs/dashjs/4.2.0/dash.all.debug.js"],
"4.1.0": ["https://cdnjs.cloudflare.com/ajax/libs/dashjs/4.1.0/dash.all.debug.js"],
Expand Down
2 changes: 2 additions & 0 deletions uapi/res/players/hlsjs.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"1.2.9": ["https://cdn.jsdelivr.net/npm/[email protected]/dist/hls.min.js"],
"1.2.1": ["https://cdn.jsdelivr.net/npm/[email protected]/dist/hls.min.js"],
"1.1.3": ["https://cdn.jsdelivr.net/npm/[email protected]/dist/hls.min.js"],
"1.0.7": ["https://cdn.jsdelivr.net/npm/[email protected]/dist/hls.min.js"],
"1.0.4": ["https://cdn.jsdelivr.net/npm/[email protected]/dist/hls.min.js"],
Expand Down