Thursday, October 27, 2011

For 0.2

Subtitle control panel is done.

There are three color for select, red, blue, and white, after click the button then click 'play' button, the color of text will be changed
The text box will show what color you have selected
There are 2 bugs for now:
1, the shadow of the text will be stacked if user clicks the play button more than once.
2, color change cannot be activated by click the default play button in player

https://github.com/keyanr/popcorn-js/commit/aa2a773a0a1a5d735f3526b274df049fb415beb5   --This won't automatically construct

https://github.com/keyanr/popcorn-js/commit/5e19f84f02068b0773645918979975a7afd6cf9e


One bug is fixed for popup window for pause, the popup window will only show when the first time the video is paused

https://github.com/keyanr/popcorn-js/commit/f26075a2bb7342658116206cb2f214e17d9d1c6b

fix one document mistake in webpage plugin, the instruction says the upper webpage should disappear at 15 second, but in fact it was 10
https://github.com/keyanr/popcorn-js/commit/d34936b2281030a0db1e441fff6e8902ce33e906

Sunday, October 23, 2011

video reaction

The first thing i learn from the video is scope.
I never know I can do this in js
function assure_positive(matrix, n){
   for (var i = 0; i<n; i +=1){
      var row = matrix[i];
      for (var i = 0; i< row.length; i +=1){
          if(row[i] <0){
              throw new error('')
 }}}}
the way I usually did is define the variable with a new name

then, another thing surprises me is function in js can be called by too many or few argument, this usually makes a error in other language

I think the closure is a tricky point
Douglas shows a example in three ways:
1st:
var name = ["one", "two", "three"];
var digit_name=function (n){
 return name[n];
}
alert(digit_name(2));
this can works, but it will reduce the performance of the function if we just need the "name" variable in the only function digit_name

2nd:
var digit_name = function(n){
  var name = ["one", "two", "three"];
  return name;
};

alert(digit_name(2));
this also works, but it will take more time to process because we need declare the array every single time we call the function

var digit_name = (function (){
  var names = ['one', 'two', 'three'];
  return function (n){
    return name[n];
  };
}());
this is the best way that can avoid two problem happens before, and it is also js' feature.

Sunday, October 16, 2011

two new items...
https://github.com/keyanr/popcorn-js/commit/f4dd20af8e27ef2c1a6823749669e69aa8cfdebe
this can change the page's background color
there are many video website have "light off" feature, it can make the background into a dark color in order to make visitor more comfortable


https://github.com/keyanr/popcorn-js/commit/11ec0d848bfb6709d0c6c1330709e43d7be58a78
this add a tiresome feature, a popup window will be showed when user wants to pause the play, however this can often be found for adv.
it has a bug for now, if the play is already pause and click again to make it play, the popup window will still appear.

Sunday, October 2, 2011

about 0.1 release

Be honest, I didn't do enough work for 0.1.
I've chosen subtitle as the topic to develop. For this plugin I have two objectives:
1, create a panel that allow user can control subtitle's place, color, size
2, allow user's comment can show on the video when playing

unfortunately, I have no idea for both for now
for 1st one, I have trouble on passing variable to control the subtitle
for 2nd one, this has lot trouble on i/o, storage, etc, so I will put this down and focus on 1st one.

I tried to use a way like pause to do that, but it doesn't work, I have to find a way to pass variable between functions, or while calling an onclick function, and will execute instantly.