-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapiMedia.mli
92 lines (80 loc) · 2.9 KB
/
apiMedia.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
(* ************************************************************************** *)
(* Project: Life - the game, Official OCaml SDK *)
(* Author: db0 ([email protected], http://db0.fr/) *)
(* Latest Version is on GitHub: https://github.com/Life-the-game/SDK-OCaml *)
(* ************************************************************************** *)
(** Medias (pictures, sounds, videos) API methods *)
open ApiTypes
(* ************************************************************************** *)
(** {3 Tools} *)
(* ************************************************************************** *)
val extension : string -> string
val extension_of_path : path -> string
val checker : contenttype -> bool
val guess_contenttype : string -> contenttype
val guess_contenttype_from_extension : string -> contenttype
val guess_contenttype_from_path : path -> contenttype
(* ************************************************************************** *)
(** {3 Picture} *)
(* ************************************************************************** *)
module type PICTURE =
sig
type t =
{
info : Info.t;
url_small : ApiTypes.url;
url_big : ApiTypes.url;
}
val from_json : Yojson.Basic.json -> t
val contenttypes : contenttype list
val checker : contenttype -> bool
end
module Picture : PICTURE
(* ************************************************************************** *)
(** {3 Video} *)
(* ************************************************************************** *)
module type VIDEO =
sig
type t =
{
info : Info.t;
url : url;
thumbnail : Picture.t;
}
val from_json : Yojson.Basic.json -> t
val contenttypes : contenttype list
val checker : contenttype -> bool
end
module Video : VIDEO
module type EXTERNALVIDEO =
sig
type provider =
| Youtube
| DailyMotion
| Vimeo
| Unknown
type t =
{
info : Info.t;
provider : provider;
video_url : url;
thumbnail : Picture.t;
}
val from_json : Yojson.Basic.json -> t
val provider_to_string : provider -> string
val provider_of_string : string -> provider
end
module ExternalVideo : EXTERNALVIDEO
(* ************************************************************************** *)
(** {3 Media} *)
(* ************************************************************************** *)
type t =
| Picture of Picture.t
| Video of Video.t
| ExternalVideo of ExternalVideo.t
| Media of (string * string)
| Id of string
val from_json : Yojson.Basic.json -> t
val thumbnail : t -> url
val url : t -> url
val id : t -> id