Skip to content

Commit

Permalink
Update TokenFilterManager.java
Browse files Browse the repository at this point in the history
  • Loading branch information
mekya committed May 12, 2021
1 parent 010ae2a commit d497514
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions src/main/java/io/antmedia/filter/TokenFilterManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -231,47 +231,4 @@ public static String getStreamId(String requestURI) {
return null;
}


/*
public static String getStreamId(String requestURI) {
requestURI = requestURI.replaceAll(REPLACE_CHARS_REGEX, "_");
int endIndex;
int startIndex = requestURI.lastIndexOf('/');
if(requestURI.contains("_")) {
//if multiple files with same id requested such as : 541211332342978513714151_480p_1.mp4
return requestURI.split("_")[0].substring(startIndex+1);
}
//if mp4 file requested
endIndex = requestURI.lastIndexOf(".mp4");
if (endIndex != -1) {
return requestURI.substring(startIndex+1, endIndex);
}
//if request is adaptive file ( ending with _adaptive.m3u8)
endIndex = requestURI.lastIndexOf(MuxAdaptor.ADAPTIVE_SUFFIX + ".m3u8");
if (endIndex != -1) {
return requestURI.substring(startIndex+1, endIndex);
}
//if specific bitrate is requested
String regex = "_[0-9]+p\\.m3u8$"; // matches ending with _[resolution]p.m3u8
if (requestURI.matches(regex)) {
endIndex = requestURI.lastIndexOf('_'); //because file format is [NAME]_[RESOLUTION]p.m3u8
return requestURI.substring(startIndex+1, endIndex);
}
//if just the m3u8 file
endIndex = requestURI.lastIndexOf(".m3u8");
if (endIndex != -1) {
return requestURI.substring(startIndex+1, endIndex);
}
return null;
}
*/
}

0 comments on commit d497514

Please sign in to comment.