Believe it or not I'm still fighting with this thing in the rails
context.
This js works PERFECTLY within its own flat file outside of rails.
However when I try and incorporate it into rails the video starts right
from the beginning, I know someone must have solved this one at some
point:
Walter...I tried my best to get this to some public location to no
avail.
at this point I changed everything to myPlayer
var endtime = 10505.89+10;
myPlayer= document.getElementById('example_video_1');
myPlayer.addEventListener('loadeddata', function(){
myPlayer.currenttime = 10505.89;
Wow...I was very close. my issue was currentTime vs currenttime. A
Captial-T was the answer to all my woes.
The lower-case t created a new function (currenttime) that it seemed to
have no idea what to do with other than put the value in it that I
passed.
Any who on to the next challenge.
I tried copy/pasting a sample video.js script straight from tutorial in
a js file titled play_time.js in /assets/javascript that looks like
this:
!doctype html
head
titleVideo.JS Example/title
link href=//vjs.zencdn.net/4.1/video-js.css rel=stylesheet
script
On Wed, May 28, 2014 at 12:22 PM, Pierre-Andre M. li...@ruby-forum.com wrote:
I tried copy/pasting a sample video.js script straight from tutorial in
a js file titled play_time.js in /assets/javascript that looks like
this:
!doctype html
head
titleVideo.JS Example/title
Understood...
Here is some pure js that I substituted into the file as well and it
does not render either.
var endtime = 10505.89+10;
myPlayer= document.getElementById('example_video_1');
myPlayer.addEventListener('loadeddata', function(){
example_video_1.currentTime = 10505.89;
On Wed, May 28, 2014 at 1:01 PM, Pierre-Andre M. li...@ruby-forum.com wrote:
myPlayer= document.getElementById('example_video_1');
My question is, how do I get that elementID through my view back to
this js file?
video id=example_video_1 ...
? It appears to already be there...
--
Walter...thanks for your responses!
Do I not already have that here:
myPlayer.addEventListener('loadeddata', function(){...
??
For the record the javascript that i have written there works great
within its own flatfile. I just can't get it to render within rails so
I know the code works...
Thanks so much for that feedback. The ONLY reason why I needed to use
videojs is so that I can start and end at a specific time within a
video. Does the built in rails paradigm have this option?
example code:
var endtime = 10505.89+10;
myPlayer=
9 matches
Mail list logo