Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dev-guide
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VeNtura
dev-guide
Commits
9ad98275
Commit
9ad98275
authored
Feb 15, 2016
by
Giang Tran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add video2html.rb
parent
6ab900b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
ruby/video2html.rb
+69
-0
No files found.
ruby/video2html.rb
0 → 100644
View file @
9ad98275
#!/bin/ruby
#
# video2html.rb - Script to tranverse all directory, find video file and make into html page to view video
# Use for internal learning material
#
# Author: Giang Tran <giangtran@zigexn.vn>
# Date: 15/2/2016
#
#
def
run
end
def
generate_html
(
file_list
)
# Tranverse all directory
def
get_all_video_files
(
current_dir
)
Dir
.
glob
(
"
#{
current_dir
}
/*.mp4"
)
do
|
video_file
|
puts
"working on:
#{
my_text_file
}
..."
end
end
# Get list of video files
# Generate template
#
def
generate_video_playlist_html
(
path
,
video_list
)
html
=
<<
EOT
<html>
<head>
<title>Playlist for
#{
path
}
</title>
</head>
<body>
<ul>
EOT
html = <<EOT
</ul>
</body>
</html>
EOT
end
def generate_video_player_html(video_path)
html = <<EOT
<html>
<head>
<title>
#{
video_path
}
</title>
</head>
<body>
<script type="text/javascript" src="/jwplayer/jwplayer.js"></script>
<div id="myElement">Loading the player...</div>
<script type="text/javascript">
jwplayer("myElement").setup({ file: "
#{
video_path
}
", "autoStart": true });
</script>
</body>
</html>
EOT
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment