-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Media Source" concept #11
Comments
Not clear how the spec is unclear on this. For instance, let's look at the two examples you give:
The current spec vocabulary includes a well defined "image" property which would be used as: {
"objectType": "note",
"content": "this is a note",
"image": "http://example.org/foo.png"
} Or, if you wanted to associate more metadata with that, such as alternative text... you could do... {
"objectType": "note",
"content": "this is a note",
"image": {
"id": "http://example.org/foo.png",
"displayName": "A picture of a Foo"
}
} How to get that picture information seems pretty clear to me. What am I missing?
Again, this seems pretty clear to me: {
"objectType": "video",
"id": "http://example.org/foo.mpg",
"url": "http://example.org/foo.mpg",
"mediaType": "video/mpeg",
"displayName": "A video of my pet Foo"
} I'm not certain what is unclear on this. As far as alternate formats is concerned... suppose I have multiple encodings of my video above. Using the current syntax, that would be as simple as: {
"objectType": "video",
"id": "http://example.org/foo.mpg",
"url": "http://example.org/foo.mpg",
"mediaType": "video/mpeg",
"displayName": "A video of my pet Foo",
"alternate": [
{
"id": "http://example.org/foo.avi",
"mediaType": "video/avi"
},
{
"id": "http://example.org/foo.mkv",
"mediaType": "video/mkv"
}
]
} Again, not certain what is lacking here. |
|
{
"image": {
"id": "http://example.org/foo.png"
}
} and {
"image": {
"src": "http://example.org/foo.png"
}
} Map that however you'd like to your own implementation. 5... {
"objectType": "video",
"displayName": "A video of my pet Foo",
"url": "http://example.org/foo_smaller.mpg",
"height": "100",
"width": "100",
"alternate": {
"id": "http://example.org/foo_larger.mpg",
"height": 400,
"width": 400
}
} height and width are already defined in the vocabulary. |
This returns us to the issue of finding the webpage representing an object again, or is that another alternate? Where do I put the link to the webpage identifying an image? How do I differentiate between this and using url for the webpage? Why do I need different logic to find the webpage for different object types? What are the semantics of all of these "alternate" objects being introduced?
What are the semantics of this alternate object? What if it has a "content" member? What if it's of a different object type? How does this tie in with the alternate link relation, which is specified in terms of MIME types?
No, there is a massive difference! If the image points to an object, then now my code has to go and chase that image object out of the database. If the alternatives point to objects, I need to go and chase all of those alternatives out of the database. For various very good reasons I store my ActivityStreams content normalised - i.e. every object is a separate DB entry, just storing the id of any object it references. Each of these "alternate" objects, each of these "image" objects now becomes a separate object. This really doesn't make sense to me - most articles don't have images as separately considered objects, for example. The different encodings of a video aren't really distinct objects. Hell, what are the semantics of commenting on an alternate? This is why I find the proliferation of objects in AS2 disturbing; because it's this thing which makes the spec nice and simple and beautiful and makes many kinds of implementation absolute hell. |
Let's suppose I have an object that represents an article... and let's suppose that we're following the guidelines currently described here: http://jasnell.github.io/w3c-socialwg-activitystreams/activitystreams2.html#link-best-practices {
"objectType": "article",
"content": "<p>This is not a very good article.</p>",
"id": "http://example.org/articles/1",
"url": "http://example.org/articles/1",
"mediaType": "text/html"
} It ought to be pretty obvious how you navigate to the HTML version of the article. Let's suppose that article has a PDF alternate... {
"objectType": "article",
"content": "<p>This is not a very good article.</p>",
"id": "http://example.org/articles/1",
"url": "http://example.org/articles/1",
"mediaType": "text/html",
"alternate": {
"id": "http://example.org/articles/1.pdf",
"url": "http://example.org/articles/1.pdf",
"mediaType": "application/pdf"
}
} Again, how we get the PDF alternate should be obvious. Now, let's suppose you have a video object... {
"objectType": "video",
"mediaType": "image/mpeg",
"id": "http://example.org/foo.mpg",
"url": "http://example.org/foo.mpg",
"alternate": {
"id": "http://example.org/player?v=foo.mpg",
"url": "http://example.org/player?v=foo.mpg",
"mediaType": "text/html"
}
} In either case, the process of locating the text/html page to display is the same: If you want the text/html, look to see if the default url will give you what you want, and if not, look at the available alternates. One disconnect that I can see in the way you and I are discussing this is that while I see AS2 as purely syntactic model, you appear to be taking the next step further into viewing it as a semantic model. When I say "object"... I literally mean it's just a JSON object. That's why I argue that there's no "real" difference between "id": "http://.../foo" and "src": "http://.../foo". Syntactically they're effectively identical. That's where the AS2 spec currently focuses. If the WG feels that a semantic model is better, then that can be worked on as an alternative. |
I believe this is addressed by the current vocab proposal. See the definition of the Link class. |
Currently, the draft leaves it somewhat unclear how an agent is supposed to locate and choose the media resource associated with objects (e.g. an image accompanying a "note", or the video behind an actual video object)
I do not attempt to fully clarify that issue here. Instead, I propose a mechanism by which we may do so: The "Media Source" object. This is based upon evolving and clarifying the "Media Link" object from AS1.
Media Source objects
Media Sources are JSON Objects which define an "embedded rich content" resource; they serve a purpose analogous to the element in HTML. They have the following attributes, which bear the same name and definition as the corresponding attribute in HTML5 where applicable:
(Open question: do we also provide the media attribute from HTML?)
A Media Source object may be abbreviated to a string which contains the value of the src property.
Media Source lists
A Media Source list is a JSON array of zero or more Media Source objects, all of which correspond to different encodings of the same resource. The list should be sorted from most preferred version to least preferred (where the most preferred version need not correspond to the highest quality version); clients may implement their own preference system.
A Media Source list may be abbreviated to a single Media Source object, which may itself be abbreviated. This corresponds to a single element array.
The text was updated successfully, but these errors were encountered: