aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/Player.hx
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2020-02-29 14:01:12 +0300
committerRblSb <msrblsb@gmail.com>2020-02-29 14:01:12 +0300
commit2ade04273717807096a07b6eb132b7677917392d (patch)
tree1598ad62bcb1f3c42b37edb7383df2704005bee5 /src/client/Player.hx
parentec7e4b5ad120828f1464cf4186287d4928b462a8 (diff)
Get youtube video title/duration with api
Diffstat (limited to 'src/client/Player.hx')
-rw-r--r--src/client/Player.hx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/Player.hx b/src/client/Player.hx
index 7bd2f4e..4327e6c 100644
--- a/src/client/Player.hx
+++ b/src/client/Player.hx
@@ -5,6 +5,7 @@ import js.Browser.document;
import client.Main.ge;
import client.players.Raw;
import client.players.Youtube;
+import Types.VideoData;
import Types.VideoItem;
using StringTools;
@@ -80,11 +81,12 @@ class Player {
this.player = player;
}
- public function getRemoteDuration(url:String, callback:(duration:Float)->Void):Void {
+ public function getVideoData(url:String, callback:(data:VideoData)->Void):Void {
+ // TODO P2 reuse player objects
if (Youtube.isYoutube(url)) {
- new Youtube(main, this).getRemoteDuration(url, callback);
+ new Youtube(main, this).getVideoData(url, callback);
} else {
- new Raw(main, this).getRemoteDuration(url, callback);
+ new Raw(main, this).getVideoData(url, callback);
}
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage