Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
a9c5eeb0
Commit
a9c5eeb0
authored
5 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-4548: double check the value of video preferred resolution
parent
344205e2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/olat/modules/video/VideoModule.java
+14
-12
14 additions, 12 deletions
src/main/java/org/olat/modules/video/VideoModule.java
src/main/java/org/olat/modules/video/ui/VideoDisplayController.java
+17
-5
17 additions, 5 deletions
...ava/org/olat/modules/video/ui/VideoDisplayController.java
with
31 additions
and
17 deletions
src/main/java/org/olat/modules/video/VideoModule.java
+
14
−
12
View file @
a9c5eeb0
...
@@ -51,6 +51,8 @@ import org.springframework.stereotype.Service;
...
@@ -51,6 +51,8 @@ import org.springframework.stereotype.Service;
public
class
VideoModule
extends
AbstractSpringModule
{
public
class
VideoModule
extends
AbstractSpringModule
{
private
static
final
Logger
log
=
Tracing
.
createLoggerFor
(
VideoModule
.
class
);
private
static
final
Logger
log
=
Tracing
.
createLoggerFor
(
VideoModule
.
class
);
public
static
final
Integer
DEFAULT_RESOLUTION
=
Integer
.
valueOf
(
720
);
private
static
final
String
VIDEO_ENABLED
=
"video.enabled"
;
private
static
final
String
VIDEO_ENABLED
=
"video.enabled"
;
private
static
final
String
VIDEOCOURSENODE_ENABLED
=
"video.coursenode.enabled"
;
private
static
final
String
VIDEOCOURSENODE_ENABLED
=
"video.coursenode.enabled"
;
...
@@ -81,8 +83,8 @@ public class VideoModule extends AbstractSpringModule {
...
@@ -81,8 +83,8 @@ public class VideoModule extends AbstractSpringModule {
@Value
(
"${video.transcoding.profile}"
)
@Value
(
"${video.transcoding.profile}"
)
private
String
transcodingProfile
;
private
String
transcodingProfile
;
private
int
[]
transcodingResolutionsArr
;
//
= new int[] {
1080,720,480,360
};
private
int
[]
transcodingResolutionsArr
;
//
1080,
720,
480,
360
private
Integer
preferredDefaultResolution
;
//
= new Integer(
720
);
private
Integer
preferredDefaultResolution
;
// 720
@Autowired
@Autowired
private
VideoHandler
videoHandler
;
private
VideoHandler
videoHandler
;
...
@@ -149,14 +151,14 @@ public class VideoModule extends AbstractSpringModule {
...
@@ -149,14 +151,14 @@ public class VideoModule extends AbstractSpringModule {
setVideoTranscodingProfile
(
this
.
transcodingProfile
);
setVideoTranscodingProfile
(
this
.
transcodingProfile
);
log
.
info
(
"video.enabled=
"
+
isEnabled
());
log
.
info
(
"video.enabled=
{}"
,
isEnabled
());
log
.
info
(
"video.coursenode.enabled=
"
+
isCoursenodeEnabled
());
log
.
info
(
"video.coursenode.enabled=
{}"
,
isCoursenodeEnabled
());
log
.
info
(
"video.transcoding.enabled=
"
+
isTranscodingEnabled
());
log
.
info
(
"video.transcoding.enabled=
{}"
,
isTranscodingEnabled
());
log
.
info
(
"video.transcoding.resolutions=
"
+
Arrays
.
toString
(
getTranscodingResolutions
()));
log
.
info
(
"video.transcoding.resolutions=
{}"
,
Arrays
.
toString
(
getTranscodingResolutions
()));
log
.
info
(
"video.transcoding.resolution.preferred=
"
+
getPreferredDefaultResolution
());
log
.
info
(
"video.transcoding.resolution.preferred=
{}"
,
getPreferredDefaultResolution
());
log
.
info
(
"video.transcoding.taskset.cpuconfig=
"
+
getTranscodingTasksetConfig
());
log
.
info
(
"video.transcoding.taskset.cpuconfig=
{}"
,
getTranscodingTasksetConfig
());
log
.
info
(
"video.transcoding.local=
"
+
isTranscodingLocal
());
log
.
info
(
"video.transcoding.local=
{}"
,
isTranscodingLocal
());
log
.
info
(
"video.transcoding.profile=
"
+
getVideoTranscodingProfile
());
log
.
info
(
"video.transcoding.profile=
{}"
,
getVideoTranscodingProfile
());
// Register video site for activation in top navigation
// Register video site for activation in top navigation
NewControllerFactory
.
getInstance
().
addContextEntryControllerCreator
(
VideoSite
.
class
.
getSimpleName
(),
NewControllerFactory
.
getInstance
().
addContextEntryControllerCreator
(
VideoSite
.
class
.
getSimpleName
(),
...
@@ -233,7 +235,7 @@ public class VideoModule extends AbstractSpringModule {
...
@@ -233,7 +235,7 @@ public class VideoModule extends AbstractSpringModule {
}
}
}
}
if
(
transcodingEnabled
)
{
if
(
transcodingEnabled
)
{
log
.
error
(
"Error, no valid transcoding dir. Disabling transcoding. video.transcoding.dir=
"
+
transcodingDir
);
log
.
error
(
"Error, no valid transcoding dir. Disabling transcoding. video.transcoding.dir=
{}"
,
transcodingDir
);
// only disable variable, don't store it in persisted properties
// only disable variable, don't store it in persisted properties
transcodingEnabled
=
false
;
transcodingEnabled
=
false
;
}
}
...
@@ -306,7 +308,7 @@ public class VideoModule extends AbstractSpringModule {
...
@@ -306,7 +308,7 @@ public class VideoModule extends AbstractSpringModule {
return
;
return
;
}
}
}
}
this
.
transcodingProfile
=
"Fast"
;
// default
;
this
.
transcodingProfile
=
"Fast"
;
// default
}
}
public
String
getVideoTranscodingProfile
()
{
public
String
getVideoTranscodingProfile
()
{
...
...
This diff is collapsed.
Click to expand it.
src/main/java/org/olat/modules/video/ui/VideoDisplayController.java
+
17
−
5
View file @
a9c5eeb0
...
@@ -177,10 +177,7 @@ public class VideoDisplayController extends BasicController {
...
@@ -177,10 +177,7 @@ public class VideoDisplayController extends BasicController {
// Load users preferred version from GUI prefs
// Load users preferred version from GUI prefs
UserSession
usess
=
ureq
.
getUserSession
();
UserSession
usess
=
ureq
.
getUserSession
();
Preferences
guiPrefs
=
usess
.
getGuiPreferences
();
Preferences
guiPrefs
=
usess
.
getGuiPreferences
();
userPreferredResolution
=
(
Integer
)
guiPrefs
.
get
(
VideoDisplayController
.
class
,
GUIPREF_KEY_PREFERRED_RESOLUTION
);
setUserPreferredResolution
((
Integer
)
guiPrefs
.
get
(
VideoDisplayController
.
class
,
GUIPREF_KEY_PREFERRED_RESOLUTION
));
if
(
userPreferredResolution
==
null
)
{
userPreferredResolution
=
videoModule
.
getPreferredDefaultResolution
();
}
mainVC
.
contextPut
(
"autoplay"
,
displayOptions
.
isAutoplay
());
mainVC
.
contextPut
(
"autoplay"
,
displayOptions
.
isAutoplay
());
...
@@ -246,6 +243,20 @@ public class VideoDisplayController extends BasicController {
...
@@ -246,6 +243,20 @@ public class VideoDisplayController extends BasicController {
mainVC
.
contextPut
(
"listenTimeUpdate"
,
enable
);
mainVC
.
contextPut
(
"listenTimeUpdate"
,
enable
);
}
}
public
Integer
getUserPreferredResolution
()
{
if
(
userPreferredResolution
==
null
)
{
userPreferredResolution
=
videoModule
.
getPreferredDefaultResolution
();
}
if
(
userPreferredResolution
==
null
)
{
userPreferredResolution
=
VideoModule
.
DEFAULT_RESOLUTION
;
}
return
userPreferredResolution
;
}
public
void
setUserPreferredResolution
(
Integer
resolution
)
{
userPreferredResolution
=
resolution
;
}
private
void
initMediaElementJs
()
{
private
void
initMediaElementJs
()
{
// load mediaelementjs player, speed and sourcechooser plugins
// load mediaelementjs player, speed and sourcechooser plugins
List
<
String
>
cssPath
=
new
ArrayList
<>();
List
<
String
>
cssPath
=
new
ArrayList
<>();
...
@@ -355,7 +366,7 @@ public class VideoDisplayController extends BasicController {
...
@@ -355,7 +366,7 @@ public class VideoDisplayController extends BasicController {
// Check if at least one has equal height, else use master as resource
// Check if at least one has equal height, else use master as resource
addMaster
&=
videoTranscoding
.
getHeight
()
<
masterResolution
.
getHeight
();
addMaster
&=
videoTranscoding
.
getHeight
()
<
masterResolution
.
getHeight
();
// Use the users preferred resolution or the next higher resolution
// Use the users preferred resolution or the next higher resolution
if
(
videoTranscoding
.
getResolution
()
>=
u
serPreferredResolution
.
intValue
())
{
if
(
videoTranscoding
.
getResolution
()
>=
getU
serPreferredResolution
()
.
intValue
())
{
preferredAvailableResolution
=
readyToPlayVideos
.
size
()
-
1
;
preferredAvailableResolution
=
readyToPlayVideos
.
size
()
-
1
;
}
}
// Calculate title. Standard title for standard resolution, original title if not standard resolution
// Calculate title. Standard title for standard resolution, original title if not standard resolution
...
@@ -699,6 +710,7 @@ public class VideoDisplayController extends BasicController {
...
@@ -699,6 +710,7 @@ public class VideoDisplayController extends BasicController {
}
}
}
}
}
}
public
static
class
VideoMarkerWrapper
{
public
static
class
VideoMarkerWrapper
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment