[Rails] Re: videojs and rails

2014-06-06 Thread Pierre-Andre M.
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:

[Rails] Re: videojs and rails

2014-05-29 Thread Pierre-Andre M.
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;

[Rails] Re: videojs and rails

2014-05-29 Thread Pierre-Andre M.
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.

[Rails] Re: videojs and rails

2014-05-28 Thread Pierre-Andre M.
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

Re: [Rails] Re: videojs and rails

2014-05-28 Thread Hassan Schroeder
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

[Rails] Re: videojs and rails

2014-05-28 Thread Pierre-Andre M.
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;

Re: [Rails] Re: videojs and rails

2014-05-28 Thread Hassan Schroeder
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... --

[Rails] Re: videojs and rails

2014-05-28 Thread Pierre-Andre M.
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...

[Rails] Re: videojs and rails

2014-05-23 Thread Pierre-Andre M.
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=