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

HTTP Live Streaming sample #53

Open
wants to merge 7 commits 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
95 changes: 95 additions & 0 deletions projects/hls/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"story":
{
"uid": "hls-story",
"name": "HLS Video Story",
"slug": "hls-story",
"description": "This is sample of HLS video display",
"default": "scene-0",

"scenes":
[
{
"uid": "scene-0",
"name": "First scene",
"slug": "first-scene",
"description": "This is the first scene",

"media":
{
"uid": "video-0",
"type": "video",

"source":
{
"format": "equi",
"streaming": "hls",
"url": "https://cdn.forgejs.org/samples/common/videos/omni-highlights/hls/filename.m3u8"
},

"options":
{
"autoPlay": true,
"loop": true,
"volume": 0.5
}
},

"camera":
{
"fov":
{
"default": 90
}
}
}
]
},

"plugins":
{
"prefix": "../../plugins/",

"engines":
[
{
"uid": "org.forgejs.videocors",
"url": "VideoCORS/"
},

{
"uid": "org.forgejs.mobilevideoplay",
"url": "MobileVideoPlay/"
},

{
"uid": "org.forgejs.gyroscopebutton",
"url": "GyroscopeButton/"
}
],

"instances":
[
{
"uid": "videocors",
"engine": "org.forgejs.videocors"
},

{
"uid": "mobilevideoplay",
"engine": "org.forgejs.mobilevideoplay"
},

{
"uid": "gyrobutton",
"engine": "org.forgejs.gyroscopebutton",

"options":
{
"bottom": 10,
"left": 10
}
}
]
}
}
63 changes: 63 additions & 0 deletions projects/hls/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!doctype html>

<html lang="en">
<head>
<meta charset="utf-8">
<meta name="author" content="GoPro, Inc.">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta http-equiv="x-ua-compatible" content="IE=edge" />
<title>ForgeJS sample - HLS videos</title>
<meta property="og:title" content="ForgeJS sample - HLS videos" />
<meta property="og:description" content="Video player based on HTTP Live Streaming technology." />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://releases.forgejs.org/latest/samples/projects/hls/" />
<meta property="og:image" content="https://cdn.forgejs.org/grav/images/ForgeJS-logo-1200x630.png" />
<meta property="og:site_name" content="ForgeJS" />

<!-- Little styling -->
<style type="text/css">
@-ms-viewport { width: device-width; }
@-o-viewport { width: device-width; zoom: 1.0; min-zoom: 1.0; max-zoom: 1.0; }
@viewport { width: device-width; zoom: 1.0; min-zoom: 1.0; max-zoom: 1.0; }

html, body
{
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}

div#container
{
height: 100%;
}
</style>
</head>

<body>
<div id="container"></div>

<!-- Include the HLS library -->
<script src="../../lib/hls.js/hls.min.js"></script>

<!-- Include the threejs custom build -->
<script src="../../lib/three.js/three.r86.custom.min.js"></script>

<!-- Include the Hammer.js library -->
<script src="../../lib/hammer.js/hammer.min.js"></script>

<!-- Include the ForgeJS library -->
<script type="text/javascript" src="../../lib/forge/forge.min.js" ></script>

<!-- Start ForgeJS -->
<script type="text/javascript">

// Create a viewer
var viewer = new FORGE.Viewer("container", "config.json");

</script>
</body>
</html>