Commit 9ad98275 by Giang Tran

Add video2html.rb

parent 6ab900b5
#!/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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment