Skip to content

Commit

Permalink
Add HTML5 Video support
Browse files Browse the repository at this point in the history
  • Loading branch information
Jagua committed Nov 7, 2016
1 parent 89e073d commit cbcaa82
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions stella.js
Expand Up @@ -709,7 +709,7 @@ Thanks:
get title () undefined,
get isValid () /^http:\/\/(tw|es|de|www)\.nicovideo\.jp\/(watch|playlist\/mylist)\//.test(U.currentURL),
get isValid () undefined,
get volume () undefined,
set volume (value) value,
Expand Down Expand Up @@ -882,7 +882,7 @@ Thanks:

get totalTime () parseInt(this.player.duration),

get isValid () false,
get isValid () !!this.player,

get volume () parseInt(this.player.volume * 100),
set volume (value) (this.player.volume = value / 100),
Expand Down Expand Up @@ -1358,15 +1358,20 @@ Thanks:
},

get player () {
return (
this.playerContainer ?
this.playerContainer.wrappedJSObject.__proto__ : null
);
},

get playerContainer () {
return (
U.getElementById('flvplayer')
||
U.getElementById('external_nicoplayer')
).wrappedJSObject.__proto__;
);
},

// get playerContainer () U.getElementByIdEx('flvplayer_container'),

get ready () {
try {
if (!this.player)
Expand Down Expand Up @@ -1485,6 +1490,8 @@ Thanks:

get totalTime () parseInt(this.player.ext_getTotalTime()),

get isValid () (this.player && U.currentURL.match(/^http:\/\/(tw|es|de|www)\.nicovideo\.jp\/(watch|playlist\/mylist)\//)),

get volume () parseInt(this.player.ext_getVolume()),
set volume (value) (this.player.ext_setVolume(value), this.volume),

Expand Down Expand Up @@ -1874,7 +1881,8 @@ Thanks:
youtube: new YouTubePlayer(this.stella),
youtube5: new YouTubePlayer5(this.stella),
youtubeuc: new YouTubeUserChannelPlayer(this.stella),
vimeo: new VimeoPlayer(this.stella)
vimeo: new VimeoPlayer(this.stella),
html5video: new VideoPlayer(this.stella)
};

// this.noGUI = true;
Expand Down

0 comments on commit cbcaa82

Please sign in to comment.