Trying to play an mp4 video on a ruby mongrel server - ruby-on-rails-3

Hello I am trying to run a ruby mongrel server on windows 7. I am using some video-js code to display a video.
<title>Waza Player</title>
<script src="video.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
VideoJS.setupAllWhenReady();
</script>
<link rel="stylesheet" href="video-js.css" type="text/css" media="screen" title="Video JS">
<body>
<div class="video-js-box">
<video id="example_video_1" class="video-js" width="720" height="304" controls="controls" preload="auto">
<source src="converted/randomvideo.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
</video>
</div>
</body>
when i use the same html and javascript in apache it works just fine.
I have setup the mimetype for mp4 video but that didn't seem to solve the issue.
any help would be appreciated
2011-04-09 06:45:55 -0700: Read error: #><Errno::ECONNABORTED: An established con
nection was aborted by the software in your host machine.>
d:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/h
ttp_response.rb:140:in `write'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/h
ttp_response.rb:140:in `write'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/handler/mongrel.rb:81:in
`block in process'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/file.rb:87:in `block in
each'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/file.rb:85:in `open'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/file.rb:85:in `each'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/handler/mongrel.rb:80:in
`process'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel.r
b:165:in `block in process_client'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel.r
b:164:in `each'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel.r
b:164:in `process_client'
d:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel.r
b:291:in `block (2 levels) in run'

Do you mean this?
<video id="example_video_1" class="video-js" width="720" height="304" controls="controlspreload="auto">
<source src="randomvideo.mp4" type="video/mp4" />
</video>

Related

How to run subtitles in video using video.js for Opera, Chrome?

I wrote code to insert subtitles in the video
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>name</title>
<link rel = "stylesheet" href = "skript/video-js.min.css" />
<script src = "skript/video.min.js"> </script>
</head>
<body>
<video
class="video-js"
controls
preload="auto"
width="640"
height="264"
data-setup='{}'>
<source src="1.mp4" type="video/mp4">
<track label="rus" kind="subtitles" srclang="ru" src="sub/rus.vtt"/>
<track label="eng" kind="subtitles" srclang="en" src="sub/eng.vtt"/>
</video>
</body>
</html>
But it does not work with browsers Opera, Chrome
Is there any way to fix this?
Did you try to embed vtt/subtitles files in m3u8 package? It works with all browsers.

videoJS HLS not working on Production Server but works in Localhost

I've been trying to make this videoJS HLS work. It works perfectly when I do it in localhost but when I upload it to the server it gives me "VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) No compatible source was found for this video."
Here's the code below:
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Video</title>
<link href="http://vjs.zencdn.net/4.12/video-js.css" rel="stylesheet">
<script src="http://vjs.zencdn.net/4.12/video.js"></script>
<script src="https://github.com/videojs/videojs-contrib-media-sources/releases/download/v0.1.0/videojs-media-sources.js"></script>
<script src="https://github.com/videojs/videojs-contrib-hls/releases/download/v0.11.2/videojs.hls.min.js"></script>
</head>
<body>
<h1>Video</h1>
<video id="my_video_1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="268"
data-setup='{}'>
<source src="https://mnmedias.api.telequebec.tv/m3u8/29880.m3u8" type='application/x-mpegURL'>
</video>
<script>
var player = videojs('my_video_1');
</script>
</body>
</html>
Can anyone tell me if I need to do something with the server to make this work? Thanks
Try to verify if your server has CORS activated.
Go to videojs cors documentation: https://github.com/videojs/videojs-contrib-hls
and here for test:
http://client.cors-api.appspot.com/client

IBM Worklight 6.1 - Previewing a Dojo hybrid app displays a blank page

I am developing a Hybrid application in Worklight 6.1 using Dojo 1.9.3. As a startup i just created a simple project with a View and a scrollable view.
Index.html
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>index</title>
<meta name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="shortcut icon" href="images/favicon.png">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="stylesheet" href="css/main.css">
<script>window.$ = window.jQuery = WLJQ;</script>
<script type="text/javascript" data-dojo-config="isDebug: false, async: true, parseOnLoad: true, mblHideAddressBar: false" src="dojo/dojo.js"></script>
</head>
<body style="display: none;">
<div data-dojo-type="dojox.mobile.View" id="mainView"
data-dojo-props="selected:true" style="background-image: url('images/bgnew.jpg'); background-repeat: repeat;">
<div data-dojo-type="dojox.mobile.ScrollableView" id="view1"
data-dojo-props="selected:true,scrollDir:'v'">
<div data-dojo-type="dojox.mobile.Heading"
data-dojo-props="label:'Login',fixed:'top'">
</div>
</div>
</div>
<script src="js/initOptions.js"></script>
<script src="js/main.js"></script>
<script src="js/messages.js"></script>
</body>
</html>
After creating building and deploying the project i tried to Run it by clicking "Preview as Common Resources" link. But unfortunately nothing displays on my screen. I checked my browser console i can see no error showing.
Dojo is already present in my www folder.
How to solve this issue.
Any help is appreciated.
Cannot reproduce. I've done the following in Worklight 6.1.0.0:
Created a new Worklight project
Added an application with the Dojo library (using the provided wizard)
Right-click on the Common folder > Run As > Preview
The browser opened, displaying the app.
The same worked if opening Worklight Console and selecting Preview as Common Resources.
Tested on OS X 10.9.2
Chrome as default external browser (Eclipse > Preferences > General Web Browser > use external web browser)
It happened to me today, and I found a solution :
Use the default Dojo provided by the IBM Worklight (actually the 1.9.1 ) instead of the 1.9.3
When I tried to import and use the 1.9.3, it did the same thing than the original poster. I think it is not already supported or there is a problem we do not think about during the importation.

Videojs TypeError: this.addEvent is not a function

Really don't know what's wrong with my code! I'm tryng to attach the end event to my player by i get this error in my firefox console:
"TypeError: this.addEvent is not a function"
I tried in so many way, but coudnt solve this problem!
<!DOCTYPE html>
<html>
<head>
<link href="video-js.css" rel="stylesheet" type="text/css">
<script src="video.js"></script>
<script>_V_.options.flash.swf = "video-js.swf";</script>
</head>
<body>
<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="400" height="500" data-setup='{}'
poster="http://video-js.zencoder.com/oceans-clip.png">
<source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4' />
<source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm' />
<source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg' />
<track kind="captions" src="demo.captions.vtt" srclang="en" label="English" />
</video>
<script>
var myPlayer = videojs("example_video_1");
videojs("example_video_1").ready(function(){
var myPlayer = this;
var videoEnd = function(){
console.log('ended')
};
myPlayer.addEvent("ended", videoEnd);
});
</script>
</body>
</html>
Can u help me please?
thanks a lot
video.js has recently been updated to version 4 and some things in the API have changed. You'll need to use myPlayer.on("ended", videoEnd);
API docs: https://github.com/videojs/video.js/blob/master/docs/api/vjs.Player.md

HTTP Dynamic Streaming with video.js flash fallback

I am evaluating video.js flash fallback capabilities for live streaming.
I can stream using either RTMP or Adobe HTTP Dynamic Streaming.
Hovewer, nonne of the options seems to be supported,
here is my demo set up
<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="640" height="264"
poster="http://video-js.zencoder.com/oceans-clip.png"
data-setup="{}">
<source src="http://mysite.com:1935/live/android.stream/manifest.f4m" type="video/mp4" />
<source src="rtmp://mysite.com/live" type="video/mp4" />
<source src="http://mysite.com:1935/live/android.stream/playlist.m3u8" type='video/mp4' />
here is what I see in the firebug console
Specified "type" attribute of "video/mp4" is not supported. Load of media resource http://mysite.com:1935/live/android.stream/manifest.f4m failed.
Specified "type" attribute of "video/mp4" is not supported. Load of media resource rtmp://mysite.com/live failed.
I went through the source code of the video.js (both JavaScript and ActionScript) and couldn't find any support for manifest files.
That is a feature I would also like to see...
Rtmp is now supported in video.js an example can be seen by using there already packaged file or this:
<!DOCTYPE html>
<html>
<head>
<title>Video.js</title>
<link href="video-js.css" rel="stylesheet" type="text/css">
<script src="video.js"></script>
<script>
videojs.options.flash.swf = "video-js.swf";
</script>
</head>
<body>
<video id="my_video_1" class="video-js vjs-default-skin" controls
preload="auto" width="640" height="264" data-setup='{ "techOrder": ["flash"] }'>
<!-- Stream testing -->
<source src="rtmp://rtmp.jim.stream.vmmacdn.be/vmma-jim-rtmplive-live/jim" type='rtmp/mp4'>
</video>
<p>Source from: http://support.akamai.com/flash/</p>
</body>
</html>
Hope this helps anyone currently stuck I know this has been dead for awhile.