Re: [whatwg] Serving up Theora video in the real world
On Tue, 28 Jul 2009 02:39:46 +0200, Andrew Scherkus scher...@google.com wrote: On Sun, 12 Jul 2009, Philip Jägenstedt wrote: Not that I except this discussion to go anywhere, but out of curiosity I checked how Firefox/Safari/Chrome actually implement canPlayType: http://wiki.whatwg.org/wiki/Video_type_parameters#Browser_Support Firefox is conservative and honest (except maybe for audio/wav; codecs=0, what could you do with the RIFF DATA chunk?) Safari gets maybe/probably backwards compared to what the spec suggests. Chrome seems to ignore the codecs parameter, claiming probably even for bogus codecs. Authors obviously can't trust the distinction between maybe and probably to any extent. That certainly is unfortunate. Thanks for calling us out :) We've addressed this in our latest builds. We now fall somewhere between Firefox and Safari in terms of conservativeness and honesty. We still give bogus codecs a maybe if the container is supported, since that seems to be what the spec suggests. That doesn't match my reading of the spec... The spec says The canPlayType(type) method must return the empty string if type is a type that the user agent knows it cannot render; and A type that the user agent knows it cannot render is one that describes a resource that the user agent definitely does not support, for example because it doesn't recognize the container type, or it doesn't support the listed codecs. A probably is only for both a container and codec match. -- Simon Pieters Opera Software
Re: [whatwg] Serving up Theora video in the real world
On Fri, 10 Jul 2009, Aryeh Gregor wrote: On Fri, Jul 10, 2009 at 4:57 AM, Robert O'Callahanrob...@ocallahan.org wrote: The way we've implemented in Firefox, we'll return yes if you specify a codecs parameter and we support every codec in your list. So v.canPlayType(video/ogg; codecs=vorbis,theora) returns probably in Firefox 3.5. I think this is reasonable because I believe that, modulo bugs in our implementation, we support the full Theora and Vorbis specs. On the other hand, we will return maybe for v.canPlayType(video/ogg). I think this distinction will be useful. In what use-case would an author want to make use of the distinction? In either case, your only course of action is to try playing the video. Maybe you'd try testing all the video types you support, and if one is maybe while another is probably you'd go with probably? That seems like a pretty marginal use case to help for the sake of such a confusing API. Programmers expect binary logic, not ternary (look at the complaints about SQL's NULL). The main use case is ordering. If you have ten variants, you might want to try the probablys before the maybes, especially if there are a lot of weird codecs involved, such that the maybes might be able to play somewhat, just not as well as the probablys. On Fri, 10 Jul 2009, Philip Jagenstedt wrote: I agree that the current interface is ugly and quite fail to see what the use for it is. With a boolean return value, canPlayType(application/ogg) would return true if one can demux Ogg streams. canPlayType(application/ogg; codecs=vorbis,dirac) would return true if one can demux Ogg and decode vorbis + dirac. What would canPlayType(video/ogg; codecs=vorbis) return? There's not enough information there to say whether or not you can play a stream labeled that way. Unless there's some compelling use case that can't be handled with the above I'd support canPlayType returning a boolean. The only issue I can see is that canPlayType(foo)==true might be interpreted as a strong promise of playability which can't be given. In that case just rename the function to wouldTryTypeInResourceSelection (no, not really). You can use the method as it is now as a boolean method, in practice. However, I think there is value in being explicit that a true return value isn't really necessarily confident. On Fri, 10 Jul 2009, Philip Jagenstedt wrote: Before someone conjures up an example where this doesn't exactly match the current behavior, the point is simply that calling canPlayType without out a codecs list or with specific codecs, you can learn exactly what is supported and not out of the container formats and codecs you are interested in, without the need for the strange probably/maybe/ API. On Sat, 11 Jul 2009, Robert O'Callahan wrote: I think it would be somewhat counterintuitive for canPlayType(video/ogg) to return true, but canPlayType(video/ogg; codecs=dirac) to return false. On Sat, 11 Jul 2009, Philip J�genstedt wrote: Well I disagree of course, because having canPlayType(video/ogg) mean anything else than can I demux Ogg streams is pointless. On Sat, 11 Jul 2009, Robert O'Callahan wrote: So you want canPlayType to mean one thing when provided a type without codecs, and another thing when provided a type with codecs. I don't think that's a good idea. Anyway, it's too late. If you care passionately about this you should have reopened this discussion months ago, not now that two browsers have just shipped support for the API in the spec. On Sun, 12 Jul 2009, Robert O'Callahan wrote: IIRC some browsers using system media frameworks don't know what codecs they support, so they still need to be able to answer maybe when codecs are provided; you still need a three-valued result. I still think it would confuse authors if you return true for canPlayType(T) and false for canPlayType(U) where U is a subset of T. I'm with Robert on this. The idea is that you can take the actual MIME type of a file, and find out what the odds are that the file will play ok. In practice, the odds are lower with video/ogg than a type that explicitly lists a supported codec. On Sun, 12 Jul 2009, Philip Jägenstedt wrote: Not that I except this discussion to go anywhere, but out of curiosity I checked how Firefox/Safari/Chrome actually implement canPlayType: http://wiki.whatwg.org/wiki/Video_type_parameters#Browser_Support Firefox is conservative and honest (except maybe for audio/wav; codecs=0, what could you do with the RIFF DATA chunk?) Safari gets maybe/probably backwards compared to what the spec suggests. Chrome seems to ignore the codecs parameter, claiming probably even for bogus codecs. Authors obviously can't trust the distinction between maybe and probably to any extent. That certainly is unfortunate. On Sat, 11 Jul 2009, Maciej Stachowiak wrote: If I were designing the API from scratch, I
Re: [whatwg] Serving up Theora video in the real world
On Mon, Jul 27, 2009 at 3:48 PM, Ian Hickson i...@hixie.ch wrote: On Fri, 10 Jul 2009, Aryeh Gregor wrote: On Fri, Jul 10, 2009 at 4:57 AM, Robert O'Callahanrob...@ocallahan.org wrote: The way we've implemented in Firefox, we'll return yes if you specify a codecs parameter and we support every codec in your list. So v.canPlayType(video/ogg; codecs=vorbis,theora) returns probably in Firefox 3.5. I think this is reasonable because I believe that, modulo bugs in our implementation, we support the full Theora and Vorbis specs. On the other hand, we will return maybe for v.canPlayType(video/ogg). I think this distinction will be useful. In what use-case would an author want to make use of the distinction? In either case, your only course of action is to try playing the video. Maybe you'd try testing all the video types you support, and if one is maybe while another is probably you'd go with probably? That seems like a pretty marginal use case to help for the sake of such a confusing API. Programmers expect binary logic, not ternary (look at the complaints about SQL's NULL). The main use case is ordering. If you have ten variants, you might want to try the probablys before the maybes, especially if there are a lot of weird codecs involved, such that the maybes might be able to play somewhat, just not as well as the probablys. On Fri, 10 Jul 2009, Philip Jagenstedt wrote: I agree that the current interface is ugly and quite fail to see what the use for it is. With a boolean return value, canPlayType(application/ogg) would return true if one can demux Ogg streams. canPlayType(application/ogg; codecs=vorbis,dirac) would return true if one can demux Ogg and decode vorbis + dirac. What would canPlayType(video/ogg; codecs=vorbis) return? There's not enough information there to say whether or not you can play a stream labeled that way. Unless there's some compelling use case that can't be handled with the above I'd support canPlayType returning a boolean. The only issue I can see is that canPlayType(foo)==true might be interpreted as a strong promise of playability which can't be given. In that case just rename the function to wouldTryTypeInResourceSelection (no, not really). You can use the method as it is now as a boolean method, in practice. However, I think there is value in being explicit that a true return value isn't really necessarily confident. On Fri, 10 Jul 2009, Philip Jagenstedt wrote: Before someone conjures up an example where this doesn't exactly match the current behavior, the point is simply that calling canPlayType without out a codecs list or with specific codecs, you can learn exactly what is supported and not out of the container formats and codecs you are interested in, without the need for the strange probably/maybe/ API. On Sat, 11 Jul 2009, Robert O'Callahan wrote: I think it would be somewhat counterintuitive for canPlayType(video/ogg) to return true, but canPlayType(video/ogg; codecs=dirac) to return false. On Sat, 11 Jul 2009, Philip Jägenstedt wrote: Well I disagree of course, because having canPlayType(video/ogg) mean anything else than can I demux Ogg streams is pointless. On Sat, 11 Jul 2009, Robert O'Callahan wrote: So you want canPlayType to mean one thing when provided a type without codecs, and another thing when provided a type with codecs. I don't think that's a good idea. Anyway, it's too late. If you care passionately about this you should have reopened this discussion months ago, not now that two browsers have just shipped support for the API in the spec. On Sun, 12 Jul 2009, Robert O'Callahan wrote: IIRC some browsers using system media frameworks don't know what codecs they support, so they still need to be able to answer maybe when codecs are provided; you still need a three-valued result. I still think it would confuse authors if you return true for canPlayType(T) and false for canPlayType(U) where U is a subset of T. I'm with Robert on this. The idea is that you can take the actual MIME type of a file, and find out what the odds are that the file will play ok. In practice, the odds are lower with video/ogg than a type that explicitly lists a supported codec. On Sun, 12 Jul 2009, Philip Jägenstedt wrote: Not that I except this discussion to go anywhere, but out of curiosity I checked how Firefox/Safari/Chrome actually implement canPlayType: http://wiki.whatwg.org/wiki/Video_type_parameters#Browser_Support Firefox is conservative and honest (except maybe for audio/wav; codecs=0, what could you do with the RIFF DATA chunk?) Safari gets maybe/probably backwards compared to what the spec suggests. Chrome seems to ignore the codecs parameter, claiming probably even for bogus codecs. Authors obviously can't trust the distinction between maybe and probably to any extent. That certainly is
Re: [whatwg] Serving up Theora video in the real world
On Mon, 13 Jul 2009 00:00:20 +0200, Robert O'Callahan rob...@ocallahan.org wrote: On Sun, Jul 12, 2009 at 10:34 AM, Philip Jägenstedt phil...@opera.comwrote: Not that I except this discussion to go anywhere, but out of curiosity I checked how Firefox/Safari/Chrome actually implement canPlayType: http://wiki.whatwg.org/wiki/Video_type_parameters#Browser_Support Firefox is conservative and honest (except maybe for audio/wav; codecs=0, what could you do with the RIFF DATA chunk?) Wave codec 0 means unknown codec, so we return maybe, but we should actually return no since in practice we refuse to play a file with 0 in the format field. We'll fix that. Safari gets maybe/probably backwards compared to what the spec suggests. Chrome seems to ignore the codecs parameter, claiming probably even for bogus codecs. Authors obviously can't trust the distinction between maybe and probably to any extent. Please file bugs against those browsers --- especially Chrome, since they haven't shipped video support yet. It's not hard to implement this right, these issues reflect sloppy development more than a fundamental problem IMHO. I agree that this isn't hard (even when using platform media frameworks), I'm only arguing that it isn't useful. However, both Mozilla and Apple representatives think differently, so I will not bother with this issue any more and simply implement it per spec as written. Also, I've reported bugs on Safari and Chrome (I think, neither give confirmation that the report has been sent successfully!) -- Philip Jägenstedt Core Developer Opera Software
Re: [whatwg] Serving up Theora video in the real world
On Mon, Jul 13, 2009 at 1:43 AM, Philip Jägenstedt phil...@opera.comwrote: Also, I've reported bugs on Safari and Chrome (I think, neither give confirmation that the report has been sent successfully!) That's odd. Both bugs.webkit.org and crbug.com tell me when I've filed a bug, and give me the bug number for reference. How did you file your issues? (Feel free to respond privately if you want, in order to avoid spamming the list) PK
Re: [whatwg] Serving up Theora video in the real world
On Sun, Jul 12, 2009 at 3:44 AM, Philip Jägenstedt phil...@opera.comwrote: On Sat, 11 Jul 2009 14:38:02 +0200, Robert O'Callahan rob...@ocallahan.org wrote: On Sat, Jul 11, 2009 at 11:51 PM, Philip Jägenstedt phil...@opera.com wrote: Yes, I'm saying that when codecs are provided true means probably and otherwise it means maybe, because the distinction is pointless. IIRC some browsers using system media frameworks don't know what codecs they support, so they still need to be able to answer maybe when codecs are provided; you still need a three-valued result. Opera is one such browser (when using GStreamer), but even if we return maybe for video/ogg; codecs=uncertain-codec, what could be done with the information? Reject that type in favour of a type for which canPlayType returns probably, or reject that type in favour of plugin-based fallback. System media frameworks need to start exposing which codecs they support, if they don't already. In the meantime, you can probably identify a minimal set of codecs that the framework definitely supports. I still think it would confuse authors if you return true for canPlayType(T) and false for canPlayType(U) where U is a subset of T. video/ogg; codecs=vorbis (U) is not a subset of video/ogg (T) as the codecs in T is the empty set, not the set of all codecs. No, video/ogg means the codecs are unspecified, not that no codecs are used. As soon as you add a codecs parameter, you are promising that those are all the codecs needed by the file. So every file that's video/ogg; codecs=vorbis is also video/ogg. Rob -- He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all. [Isaiah 53:5-6]
Re: [whatwg] Serving up Theora video in the real world
On Sun, Jul 12, 2009 at 10:34 AM, Philip Jägenstedt phil...@opera.comwrote: Not that I except this discussion to go anywhere, but out of curiosity I checked how Firefox/Safari/Chrome actually implement canPlayType: http://wiki.whatwg.org/wiki/Video_type_parameters#Browser_Support Firefox is conservative and honest (except maybe for audio/wav; codecs=0, what could you do with the RIFF DATA chunk?) Wave codec 0 means unknown codec, so we return maybe, but we should actually return no since in practice we refuse to play a file with 0 in the format field. We'll fix that. Safari gets maybe/probably backwards compared to what the spec suggests. Chrome seems to ignore the codecs parameter, claiming probably even for bogus codecs. Authors obviously can't trust the distinction between maybe and probably to any extent. Please file bugs against those browsers --- especially Chrome, since they haven't shipped video support yet. It's not hard to implement this right, these issues reflect sloppy development more than a fundamental problem IMHO. Rob -- He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all. [Isaiah 53:5-6]
Re: [whatwg] Serving up Theora video in the real world
2009/7/13 Robert O'Callahan rob...@ocallahan.org: On Mon, Jul 13, 2009 at 10:00 AM, Robert O'Callahan rob...@ocallahan.org wrote: It's not hard to implement this right, these issues reflect sloppy development more than a fundamental problem IMHO. That sounded mean, I apologize. What I want to say is that sometimes, a pattern of bugs indicates that a feature is very hard to implement correctly. This is not one of those times. Should clarified wording be written up for the spec? - d.
Re: [whatwg] Serving up Theora video in the real world
On Mon, Jul 13, 2009 at 11:14 AM, David Gerard dger...@gmail.com wrote: Should clarified wording be written up for the spec? The wording's fine. Rob -- He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all. [Isaiah 53:5-6]
Re: [whatwg] Serving up Theora video in the real world
On Sat, 11 Jul 2009 03:35:22 +0200, Robert O'Callahan rob...@ocallahan.org wrote: On Sat, Jul 11, 2009 at 9:37 AM, Philip Jagenstedt phil...@opera.comwrote: the point is simply that calling canPlayType without out a codecs list or with specific codecs, you can learn exactly what is supported and not out of the container formats and codecs you are interested in, without the need for the strange probably/maybe/ API. I think it would be somewhat counterintuitive for canPlayType(video/ogg) to return true, but canPlayType(video/ogg; codecs=dirac) to return false. Well I disagree of course, because having canPlayType(video/ogg) mean anything else than can I demux Ogg streams is pointless. Quoting myself from http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2008-November/017212.html (replies from Ian) On Thu, 13 Nov 2008, Philip Jägenstedt wrote: When asking about application/ogg, this could mean 2 things: 1. can I demux Ogg streams? 2. can I demux Ogg streams and decode unknown codecs? It's the second (and thus the answer can only ever be maybe or no). [snip] Unless the codecs parameter is to be made mandatory I think that spec should explicitly make it such that the question asked is 1. In either case we will end up there because 2 is not a meaningful question anduser agents will make untruthful answers in attempts to stay compatiblewith unknown and future content (which might be supported by installingnew codecs in the media framework without upgrading the browser). Currently the spec says we should interpret canPlayType(video/ogg) as can I demux Ogg streams and decode unknown codecs?, which is a pointless question. If we seriously believe that people need the level of control provided by the 3-state answer, just let them make several queries to ask the precise questions they want to ask. -- Philip Jägenstedt Core Developer Opera Software
Re: [whatwg] Serving up Theora video in the real world
On Sat, 11 Jul 2009 03:31:50 +0200, Robert O'Callahan rob...@ocallahan.org wrote: On Sat, Jul 11, 2009 at 5:23 AM, Aryeh Gregor simetrical+...@gmail.comsimetrical%2b...@gmail.com wrote: Maybe you'd try testing all the video types you support, and if one is maybe while another is probably you'd go with probably? Right. Or you might have plugin-based fallback you can use if you get maybe. Other authors with no plugin-based fallback would go ahead if they get maybe. Programmers expect binary logic, not ternary (look at the complaints about SQL's NULL). I agree. In the past I argued for two boolean functions. Anyway, it's a little late now to change canPlayType more than we just did. There is already deployed content checking for probably/maybe. Not really, the spec isn't stable yet and all deployed content is still experimental. We still have a chance to fix broken APIs (or live with them for 100 years). -- Philip Jägenstedt Core Developer Opera Software
Re: [whatwg] Serving up Theora video in the real world
On Sat, Jul 11, 2009 at 9:38 PM, Philip Jägenstedt phil...@opera.comwrote: Well I disagree of course, because having canPlayType(video/ogg) mean anything else than can I demux Ogg streams is pointless. So you want canPlayType to mean one thing when provided a type without codecs, and another thing when provided a type with codecs. I don't think that's a good idea. Anyway, it's too late. If you care passionately about this you should have reopened this discussion months ago, not now that two browsers have just shipped support for the API in the spec. Rob -- He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all. [Isaiah 53:5-6]
Re: [whatwg] Serving up Theora video in the real world
On Sat, 11 Jul 2009 13:15:14 +0200, Robert O'Callahan rob...@ocallahan.org wrote: On Sat, Jul 11, 2009 at 9:38 PM, Philip Jägenstedt phil...@opera.comwrote: Well I disagree of course, because having canPlayType(video/ogg) mean anything else than can I demux Ogg streams is pointless. So you want canPlayType to mean one thing when provided a type without codecs, and another thing when provided a type with codecs. I don't think that's a good idea. Yes, I'm saying that when codecs are provided true means probably and otherwise it means maybe, because the distinction is pointless. Anyway, it's too late. If you care passionately about this you should have reopened this discussion months ago, not now that two browsers have just shipped support for the API in the spec. Ian, if you agree that it's too late to change you needn't reply to any of my other points, I won't push the issue further. -- Philip Jägenstedt Core Developer Opera Software
Re: [whatwg] Serving up Theora video in the real world
2009/7/11 Robert O'Callahan rob...@ocallahan.org On Sat, Jul 11, 2009 at 9:38 PM, Philip Jägenstedt phil...@opera.comwrote: Well I disagree of course, because having canPlayType(video/ogg) mean anything else than can I demux Ogg streams is pointless. So you want canPlayType to mean one thing when provided a type without codecs, and another thing when provided a type with codecs. I don't think that's a good idea. Anyway, it's too late. If you care passionately about this you should have reopened this discussion months ago, not now that two browsers have just shipped support for the API in the spec. Disagree -- the whole point of candidate rec (which the spec is driving towards) is to find out how implementable the spec is -- not just from the browser side, but from a web author side as well. If a feature turns out to not be implementable / usable in practice, that is certainly valid feedback at this stage. (Not to say it wouldn't be better to have had this conversation earlier, but I definitely don't think that the ship has sailed on this, and in practice some things you only find out once it's implemented and you can actually try using it.) Rob -- He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all. [Isaiah 53:5-6]
Re: [whatwg] Serving up Theora video in the real world
On Sat, 11 Jul 2009 14:38:02 +0200, Robert O'Callahan rob...@ocallahan.org wrote: On Sat, Jul 11, 2009 at 11:51 PM, Philip Jägenstedt phil...@opera.comwrote: Yes, I'm saying that when codecs are provided true means probably and otherwise it means maybe, because the distinction is pointless. IIRC some browsers using system media frameworks don't know what codecs they support, so they still need to be able to answer maybe when codecs are provided; you still need a three-valued result. Opera is one such browser (when using GStreamer), but even if we return maybe for video/ogg; codecs=uncertain-codec, what could be done with the information? The only way of knowing is trying to play it, which is what the resource selection algorithm would do. That's true of both maybe and probably, neither are actual guarantees. Is there any use case for distinguishing them? This is primarily a disagreement about what kind of API is more aesthetically pleasing, either way exposes the same (useful) information. I still think it would confuse authors if you return true for canPlayType(T) and false for canPlayType(U) where U is a subset of T. video/ogg; codecs=vorbis (U) is not a subset of video/ogg (T) as the codecs in T is the empty set, not the set of all codecs. Or did you have some other values of U and T in mind? -- Philip Jägenstedt Core Developer Opera Software
Re: [whatwg] Serving up Theora video in the real world
On Jul 10, 2009, at 6:31 PM, Robert O'Callahan wrote: On Sat, Jul 11, 2009 at 5:23 AM, Aryeh Gregor simetrical+...@gmail.com wrote: Maybe you'd try testing all the video types you support, and if one is maybe while another is probably you'd go with probably? Right. Or you might have plugin-based fallback you can use if you get maybe. Other authors with no plugin-based fallback would go ahead if they get maybe. Programmers expect binary logic, not ternary (look at the complaints about SQL's NULL). I agree. In the past I argued for two boolean functions. Anyway, it's a little late now to change canPlayType more than we just did. There is already deployed content checking for probably/maybe. If I were designing the API from scratch, I would have two functions, mightPlayType() and canDefinitelyPlayType(). That would make it easier to write natural boolean expressions. However, I think the current canPlayType() is good enough - the empty string pseudo-false return should make it mostly ok to treat canPlayType as a boolean method. Also, it's a change that we felt we could rush into Firefox and Safari updates without undue risk, before the even more broken version with the no return got locked in. To everyone proposing more wide-ranging changes , this API is probably past the point where we can freely change it any way we want. Regards, Maciej
Re: [whatwg] Serving up Theora video in the real world
On Jul 11, 2009, at 7:56 AM, Ian Fette (イアンフェッティ) wrote: 2009/7/11 Robert O'Callahan rob...@ocallahan.org On Sat, Jul 11, 2009 at 9:38 PM, Philip Jägenstedt phil...@opera.com wrote: Well I disagree of course, because having canPlayType(video/ogg) mean anything else than can I demux Ogg streams is pointless. So you want canPlayType to mean one thing when provided a type without codecs, and another thing when provided a type with codecs. I don't think that's a good idea. Anyway, it's too late. If you care passionately about this you should have reopened this discussion months ago, not now that two browsers have just shipped support for the API in the spec. Disagree -- the whole point of candidate rec (which the spec is driving towards) is to find out how implementable the spec is -- not just from the browser side, but from a web author side as well. If a feature turns out to not be implementable / usable in practice, that is certainly valid feedback at this stage. (Not to say it wouldn't be better to have had this conversation earlier, but I definitely don't think that the ship has sailed on this, and in practice some things you only find out once it's implemented and you can actually try using it.) At this point, I think video should only be changed incompatibly if it is discovered to be literally unimplementable (unlikely now that it's been implemented twice) or unusable for its desired use cases, and an incompatible break is the only fix. But I don't think the issue at hand is that serious - we're just talking about potential refinement. The design we have now for canPlayType is not my favorite, but I can't really say it's broken. Regards, Maciej
Re: [whatwg] Serving up Theora video in the real world
On Sat, 11 Jul 2009 21:15:47 +0200, Maciej Stachowiak m...@apple.com wrote: On Jul 11, 2009, at 7:56 AM, Ian Fette (イアンフェッティ) wrote: 2009/7/11 Robert O'Callahan rob...@ocallahan.org On Sat, Jul 11, 2009 at 9:38 PM, Philip Jägenstedt phil...@opera.com wrote: Well I disagree of course, because having canPlayType(video/ogg) mean anything else than can I demux Ogg streams is pointless. So you want canPlayType to mean one thing when provided a type without codecs, and another thing when provided a type with codecs. I don't think that's a good idea. Anyway, it's too late. If you care passionately about this you should have reopened this discussion months ago, not now that two browsers have just shipped support for the API in the spec. Disagree -- the whole point of candidate rec (which the spec is driving towards) is to find out how implementable the spec is -- not just from the browser side, but from a web author side as well. If a feature turns out to not be implementable / usable in practice, that is certainly valid feedback at this stage. (Not to say it wouldn't be better to have had this conversation earlier, but I definitely don't think that the ship has sailed on this, and in practice some things you only find out once it's implemented and you can actually try using it.) At this point, I think video should only be changed incompatibly if it is discovered to be literally unimplementable (unlikely now that it's been implemented twice) or unusable for its desired use cases, and an incompatible break is the only fix. But I don't think the issue at hand is that serious - we're just talking about potential refinement. The design we have now for canPlayType is not my favorite, but I can't really say it's broken. Not that I except this discussion to go anywhere, but out of curiosity I checked how Firefox/Safari/Chrome actually implement canPlayType: http://wiki.whatwg.org/wiki/Video_type_parameters#Browser_Support Firefox is conservative and honest (except maybe for audio/wav; codecs=0, what could you do with the RIFF DATA chunk?) Safari gets maybe/probably backwards compared to what the spec suggests. Chrome seems to ignore the codecs parameter, claiming probably even for bogus codecs. Authors obviously can't trust the distinction between maybe and probably to any extent. -- Philip Jägenstedt Core Developer Opera Software
Re: [whatwg] Serving up Theora video in the real world
On Jul 11, 2009, at 3:34 PM, Philip Jägenstedt wrote: Not that I except this discussion to go anywhere, but out of curiosity I checked how Firefox/Safari/Chrome actually implement canPlayType: http://wiki.whatwg.org/wiki/Video_type_parameters#Browser_Support Firefox is conservative and honest (except maybe for audio/wav; codecs=0, what could you do with the RIFF DATA chunk?) Safari gets maybe/probably backwards compared to what the spec suggests. Chrome seems to ignore the codecs parameter, claiming probably even for bogus codecs. Authors obviously can't trust the distinction between maybe and probably to any extent. Thanks for doing the research. We'd appreciate bug reports on any Safari/WebKit behavior that seems incorrect, and I'll certainly ask the Apple folks who work on this to study the matter. Our life is a little harder than Mozilla's since we use a separate media framework and support an open-ended set of codecs. But still, we'd like to get this right. I think you are probably right that the maybe/probably distinction is not currently reliable and likely not relied on in practice. What we do seem to have is some reliance on the answer being one of maybe or probably as indication of a positive result. I don't know the extent of such reliance but I suspect it will be worse before we can design, implement and ship a thorough redesign. One possibility is to consider canPlayType a lost cause as far as having a really great API, and add a cleaner and better defined API in parallel. But I'm not sure the improvement would be worth the cost. Depends on the specifics. - Maciej
Re: [whatwg] Serving up Theora video in the real world
Robert O'Callahan wrote: On Fri, Jul 10, 2009 at 7:36 PM, James Graham jgra...@opera.com wrote: Is there a good reason to return the empty string rather than false? The empty string seems very unhelpful to authors since it doesn't play nicely with debugging prompts and is non-obvious to infer meaning from, which is likely to confuse novices who are e.g. playing with the API in an interactive console session. Returning false makes it difficult to bind to languages other than JS. What would you write for the return type in IDL? Is there any good reason to worry about languages other than javascript? Writing APIs that work well in the one language implemnented in web browsers seems better than writing mediocre APIs that can be used in many other languages. I'm not sure what is needed for IDL to cope with this though.
Re: [whatwg] Serving up Theora video in the real world
On Fri, Jul 10, 2009 at 4:57 AM, Robert O'Callahanrob...@ocallahan.org wrote: The way we've implemented in Firefox, we'll return yes if you specify a codecs parameter and we support every codec in your list. So v.canPlayType(video/ogg; codecs=vorbis,theora) returns probably in Firefox 3.5. I think this is reasonable because I believe that, modulo bugs in our implementation, we support the full Theora and Vorbis specs. On the other hand, we will return maybe for v.canPlayType(video/ogg). I think this distinction will be useful. In what use-case would an author want to make use of the distinction? In either case, your only course of action is to try playing the video. Maybe you'd try testing all the video types you support, and if one is maybe while another is probably you'd go with probably? That seems like a pretty marginal use case to help for the sake of such a confusing API. Programmers expect binary logic, not ternary (look at the complaints about SQL's NULL).
Re: [whatwg] Serving up Theora video in the real world
On Fri, 10 Jul 2009 19:23:44 +0200, Aryeh Gregor simetrical+...@gmail.com wrote: On Fri, Jul 10, 2009 at 4:57 AM, Robert O'Callahanrob...@ocallahan.org wrote: The way we've implemented in Firefox, we'll return yes if you specify a codecs parameter and we support every codec in your list. So v.canPlayType(video/ogg; codecs=vorbis,theora) returns probably in Firefox 3.5. I think this is reasonable because I believe that, modulo bugs in our implementation, we support the full Theora and Vorbis specs. On the other hand, we will return maybe for v.canPlayType(video/ogg). I think this distinction will be useful. In what use-case would an author want to make use of the distinction? In either case, your only course of action is to try playing the video. Maybe you'd try testing all the video types you support, and if one is maybe while another is probably you'd go with probably? That seems like a pretty marginal use case to help for the sake of such a confusing API. Programmers expect binary logic, not ternary (look at the complaints about SQL's NULL). I agree that the current interface is ugly and quite fail to see what the use for it is. With a boolean return value, canPlayType(application/ogg) would return true if one can demux Ogg streams. canPlayType(application/ogg; codecs=vorbis,dirac) would return true if one can demux Ogg and decode vorbis + dirac. Differentiating between maybe/probably really seems like an edge use case, but you could if you really wanted to: function tertiaryCanPlayType(mime) { [container, codecs] = mime.split(;); if (canPlayType(mime)) { return codecs ? probably : maybe; } else { // if there are codecs, canPlayType(container) would tell you if problem is with the container format or the codecs return ; // was no } } Unless there's some compelling use case that can't be handled with the above I'd support canPlayType returning a boolean. The only issue I can see is that canPlayType(foo)==true might be interpreted as a strong promise of playability which can't be given. In that case just rename the function to wouldTryTypeInResourceSelection (no, not really). -- Philip Jägenstedt Core Developer Opera Software
Re: [whatwg] Serving up Theora video in the real world
On Fri, 10 Jul 2009 23:26:40 +0200, Philip Jagenstedt phil...@opera.com wrote: On Fri, 10 Jul 2009 19:23:44 +0200, Aryeh Gregor simetrical+...@gmail.com wrote: On Fri, Jul 10, 2009 at 4:57 AM, Robert O'Callahanrob...@ocallahan.org wrote: The way we've implemented in Firefox, we'll return yes if you specify a codecs parameter and we support every codec in your list. So v.canPlayType(video/ogg; codecs=vorbis,theora) returns probably in Firefox 3.5. I think this is reasonable because I believe that, modulo bugs in our implementation, we support the full Theora and Vorbis specs. On the other hand, we will return maybe for v.canPlayType(video/ogg). I think this distinction will be useful. In what use-case would an author want to make use of the distinction? In either case, your only course of action is to try playing the video. Maybe you'd try testing all the video types you support, and if one is maybe while another is probably you'd go with probably? That seems like a pretty marginal use case to help for the sake of such a confusing API. Programmers expect binary logic, not ternary (look at the complaints about SQL's NULL). I agree that the current interface is ugly and quite fail to see what the use for it is. With a boolean return value, canPlayType(application/ogg) would return true if one can demux Ogg streams. canPlayType(application/ogg; codecs=vorbis,dirac) would return true if one can demux Ogg and decode vorbis + dirac. Differentiating between maybe/probably really seems like an edge use case, but you could if you really wanted to: function tertiaryCanPlayType(mime) { [container, codecs] = mime.split(;); if (canPlayType(mime)) { return codecs ? probably : maybe; } else { // if there are codecs, canPlayType(container) would tell you if problem is with the container format or the codecs return ; // was no } } Before someone conjures up an example where this doesn't exactly match the current behavior, the point is simply that calling canPlayType without out a codecs list or with specific codecs, you can learn exactly what is supported and not out of the container formats and codecs you are interested in, without the need for the strange probably/maybe/ API. Unless there's some compelling use case that can't be handled with the above I'd support canPlayType returning a boolean. The only issue I can see is that canPlayType(foo)==true might be interpreted as a strong promise of playability which can't be given. In that case just rename the function to wouldTryTypeInResourceSelection (no, not really). -- Philip Jägenstedt Core Developer Opera Software
Re: [whatwg] Serving up Theora video in the real world
On Sat, Jul 11, 2009 at 5:23 AM, Aryeh Gregor simetrical+...@gmail.comsimetrical%2b...@gmail.com wrote: Maybe you'd try testing all the video types you support, and if one is maybe while another is probably you'd go with probably? Right. Or you might have plugin-based fallback you can use if you get maybe. Other authors with no plugin-based fallback would go ahead if they get maybe. Programmers expect binary logic, not ternary (look at the complaints about SQL's NULL). I agree. In the past I argued for two boolean functions. Anyway, it's a little late now to change canPlayType more than we just did. There is already deployed content checking for probably/maybe. Rob -- He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all. [Isaiah 53:5-6]
Re: [whatwg] Serving up Theora video in the real world
On Sat, Jul 11, 2009 at 9:37 AM, Philip Jagenstedt phil...@opera.comwrote: the point is simply that calling canPlayType without out a codecs list or with specific codecs, you can learn exactly what is supported and not out of the container formats and codecs you are interested in, without the need for the strange probably/maybe/ API. I think it would be somewhat counterintuitive for canPlayType(video/ogg) to return true, but canPlayType(video/ogg; codecs=dirac) to return false. Rob -- He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all. [Isaiah 53:5-6]
[whatwg] Serving up Theora video in the real world
(this is not quite about the standard itself, but it is about how to use shiny new bits of it in real world practice) Wikimedia is preparing to use video (and quite likely HTML5 all through) for serving up Ogg Theora video in MediaWiki. Desktop is easy: * In the one released browser that supports video and Theora, Firefox 3.5, this will Just Work. * In Safari with XiphQT, we can *probably* detect Theora's MIME type as being supported and it will Just Work (more or less). * Everyone else gets the Cortado player (written in Java), with a link suggesting FF 3.5 for a better video experience. The question is what to do for platforms such as the iPhone, which doesn't even run Java. Is there any way to install an additional codec in the iPhone browser? Is it (even theoretically) possible to put a free app on the AppStore just to play Ogg Theora video for our users? (There are many AppStore apps that support Ogg Vorbis, don't know if any support Theora - so presumably AppStore stuff doesn't give Apple the feared submarine patent exposure.) Our goal is to have happy end users who don't have to think about this rubbish. - d.
Re: [whatwg] Serving up Theora video in the real world
David Gerard wrote: * In the one released browser that supports video and Theora, Firefox 3.5, this will Just Work. Two! Firefox and Chrome. --Ben signature.asc Description: OpenPGP digital signature
Re: [whatwg] Serving up Theora video in the real world
On Thu, Jul 9, 2009 at 10:04 PM, David Gerarddger...@gmail.com wrote: Really? I thought that was next Chrome, not this Chrome. It works in the developer version: http://dev.chromium.org/getting-involved/dev-channel Also in experimental Opera builds: http://labs.opera.com/news/2008/11/25/ But not in any stable browser release I'm aware of aside from Firefox 3.5, or Safari plus XiphQT.
Re: [whatwg] Serving up Theora video in the real world
David Gerard wrote: 2009/7/9 Benjamin M. Schwartz bmsch...@fas.harvard.edu: David Gerard wrote: * In the one released browser that supports video and Theora, Firefox 3.5, this will Just Work. Two! Firefox and Chrome. Really? I thought that was next Chrome, not this Chrome. It seems you're rightish. Google, as usual, is having lots of fun with their stable/beta/release distinctions. See if you can decipher http://googlechromereleases.blogspot.com/ . At any rate, video is not supported in Chrome Stable, which is currently 2.0.x. signature.asc Description: OpenPGP digital signature
Re: [whatwg] Serving up Theora video in the real world
2009/7/9 David Gerard dger...@gmail.com: * Everyone else gets the Cortado player (written in Java), with a link suggesting FF 3.5 for a better video experience. I should note, by the way, that this isn't a great option - second and subsequent videos in Cortado are just fine, but the thirty seconds waiting for Java to start up the first time you play a video *really sucks*. - d.
Re: [whatwg] Serving up Theora video in the real world
2009/7/9 Benjamin M. Schwartz bmsch...@fas.harvard.edu: It seems you're rightish. Google, as usual, is having lots of fun with their stable/beta/release distinctions. See if you can decipher http://googlechromereleases.blogspot.com/ . At any rate, video is not supported in Chrome Stable, which is currently 2.0.x. Yep. For these purposes we're only considering release stuff. Anyone got ideas on the iPhone problem? - d.
Re: [whatwg] Serving up Theora video in the real world
2009/7/9 Benjamin M. Schwartz bmsch...@fas.harvard.edu: David Gerard wrote: * In the one released browser that supports video and Theora, Firefox 3.5, this will Just Work. Two! Firefox and Chrome. Really? I thought that was next Chrome, not this Chrome. What's ETA on the next Chrome? - d.
Re: [whatwg] Serving up Theora video in the real world
On Thu, Jul 9, 2009 at 5:59 PM, David Gerarddger...@gmail.com wrote: * In Safari with XiphQT, we can *probably* detect Theora's MIME type as being supported and it will Just Work (more or less). I'm now being told that our workaround of checking for system mime types stopped working and isn't working for users with Safari 4.0.2 and fresh XiphQT installs. We've been doing querying navigator.plugins to look for 'video/ogg' since canPlayType fails for Ogg/Theora even when XiphQT is installed for current Safari (I understand that this is fixed in development builds). I'm trying to figure out where the plugin mime detection workaround stopped and why. On Thu, Jul 9, 2009 at 6:00 PM, Benjamin M. Schwartzbmsch...@fas.harvard.edu wrote: David Gerard wrote: * In the one released browser that supports video and Theora, Firefox 3.5, this will Just Work. Two! Firefox and Chrome. AFAIK Chrome support is only in the developer builds, not the full released stuff yet.
Re: [whatwg] Serving up Theora video in the real world
2009/7/9 David Gerard dger...@gmail.com 2009/7/9 Benjamin M. Schwartz bmsch...@fas.harvard.edu: It seems you're rightish. Google, as usual, is having lots of fun with their stable/beta/release distinctions. See if you can decipher http://googlechromereleases.blogspot.com/ . At any rate, video is not supported in Chrome Stable, which is currently 2.0.x. Yep. For these purposes we're only considering release stuff. As Peter said, please don't just block Chrome flat out -- if you must, just block Chrome under version 3. Note that when we push 3 to stable, everyone will be automatically updated. As for how to decipher the releases blog, at the beginning of each post we state which channels this affects (Dev/Beta/Stable). Dev is, as it sounds, the latest and most frequently released to, stable is less frequently updated. Eventually, when we're happy, we take a dev release and call it beta and then stable. Anyone got ideas on the iPhone problem? - d.
Re: [whatwg] Serving up Theora video in the real world
On Thu, Jul 9, 2009 at 3:34 PM, David Gerarddger...@gmail.com wrote: Anyone got ideas on the iPhone problem? I think this is off topic, and I am not an iPhone developer, but: Assuming the app store terms allow video players, it should be possible to distribute some sort of dedicated player application, free or otherwise. I believe the fee for a cert to sign applications is currently $100/year. However, the iPhone doesn't have a shared filesystem, or helper-applications in the normal sense, At least not as far as I can tell. The work-around I'm aware of is for site authors to check if you're running on the iPhone in javascript, and rewrite the video elements to normal anchors with a custom schema, e.g. a href=oggplayer://example.com/file.ogvClick here to watch in Ogg Player/a. Then, if the user has installed the Ogg Player app, which registers itself has handling the 'oggplayer' schama, Safari will pass the custom uri to it, and it can download/stream/whathaveyou. -r
Re: [whatwg] Serving up Theora video in the real world
2009/7/9 Ian Fette (イアンフェッティ) ife...@google.com: As Peter said, please don't just block Chrome flat out -- if you must, just block Chrome under version 3. Note that when we push 3 to stable, everyone will be automatically updated. As version 3 is easily detectable, presumably we'd just detect it. The Java interface takes 30 seconds to start, the first 10 of which your browser or computer appears to have hung. It's really horrible. Which is a pity, as Cortado is otherwise really cool. So avoiding having to drop back to that is really really good, and so giving the native Theora in video experience to Chrome 3 users is just the thing :-) So let's hope Safari with XiphQT remains detectable ... - d.
Re: [whatwg] Serving up Theora video in the real world
On Jul 9, 2009, at 3:34 PM, Peter Kasting wrote: On Thu, Jul 9, 2009 at 3:30 PM, Aryeh Gregor Simetrical +...@gmail.com wrote: On Thu, Jul 9, 2009 at 10:04 PM, David Gerarddger...@gmail.com wrote: Really? I thought that was next Chrome, not this Chrome. It works in the developer version: http://dev.chromium.org/getting-involved/dev-channel For any site author needing a UA sniffing route to determine whether a visitor's Chrome version supports video, just look for version 3.x or higher. I'd recommend using feature testing or fallback instead though, if you can make that work for your site. - Maciej
Re: [whatwg] Serving up Theora video in the real world
On Jul 9, 2009, at 3:11 PM, Gregory Maxwell wrote: On Thu, Jul 9, 2009 at 5:59 PM, David Gerarddger...@gmail.com wrote: * In Safari with XiphQT, we can *probably* detect Theora's MIME type as being supported and it will Just Work (more or less). I'm now being told that our workaround of checking for system mime types stopped working and isn't working for users with Safari 4.0.2 and fresh XiphQT installs. We've been doing querying navigator.plugins to look for 'video/ogg' since canPlayType fails for Ogg/Theora even when XiphQT is installed for current Safari (I understand that this is fixed in development builds). I'm trying to figure out where the plugin mime detection workaround stopped and why. I don't think we did anything intentional in 4.0.2 to break detection of XiphQT. If you have a solid reproducible case, please file a bug. On the other hand, I suspect the canPlayType fix will have shipped by the time we manage to do any fixes for the navigator.plugins technique. Regards, Maciej
Re: [whatwg] Serving up Theora video in the real world
On Thu, Jul 9, 2009 at 7:14 PM, Maciej Stachowiakm...@apple.com wrote: I don't think we did anything intentional in 4.0.2 to break detection of XiphQT. If you have a solid reproducible case, please file a bug. On the other hand, I suspect the canPlayType fix will have shipped by the time we manage to do any fixes for the navigator.plugins technique. It may even be something about the XiphQT install that changed. Or, more significantly, something the XiphQT install can fix. If so we don't have the problem of where we can't tell Safari users to install XiphQT (because if they do they'll just continue to get the message). At the moment we're just going to have to tell Safari users to install Firefox 3.5 though.
Re: [whatwg] Serving up Theora video in the real world
On Thu, Jul 9, 2009 at 7:24 PM, Maciej Stachowiakm...@apple.com wrote: I thought your plan was to use Cortado for plugins that don't have video+Theora. Why would you single out Safari users for a worse experience? As david mentioned, Cortado is a worse experience. What we've been planning was that everyone without native support who appeared to be on a platform which could have native support were going to get a recommendation to upgrade/change software along with the Cortado. This would have resulted in Safari users being advised to install XiphQT, but since that doesn't appear to work anymore for the shipping software it will just get treated like Firefox 3.0 and other video-less browsers.
Re: [whatwg] Serving up Theora video in the real world
2009/7/10 Ian Fette (イアンフェッティ) ife...@google.com To me, this seems like a great test if canPlayType actually works in practice. In the perfect world, it would be great to do getElementById('video'), createElement, and then canPlayType('video/whatever','theora'). If this simple use case doesn't work, I would ask if it's even worth keeping canPlayType in the spec. var v = document.getElementById(video); if (v.canPlayType v.canPlayType(video/ogg; codecs=vorbis,theora)) { ... } else { ... } should work great. Certainly does in Firefox. Rob -- He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all. [Isaiah 53:5-6]
Re: [whatwg] Serving up Theora video in the real world
On Thu, Jul 9, 2009 at 10:35 PM, Robert O'Callahanrob...@ocallahan.org wrote: 2009/7/10 Ian Fette (イアンフェッティ) ife...@google.com To me, this seems like a great test if canPlayType actually works in practice. In the perfect world, it would be great to do getElementById('video'), createElement, and then canPlayType('video/whatever','theora'). If this simple use case doesn't work, I would ask if it's even worth keeping canPlayType in the spec. var v = document.getElementById(video); if (v.canPlayType v.canPlayType(video/ogg; codecs=vorbis,theora)) { ... } else { ... } should work great. Certainly does in Firefox. It works. Except where it doesn't. It's the where it doesn't that counts. At the moment Safari has issues. Out of two widely used production browsers with HTML5 support, one is broken. Not good odds, but I'm hopeful for the future. There is also the potential problem of It technically supports format X; but the browser developer never bothered testing X and its too buggy to be usable. My preference, however, is to start with the basic canPlayType test and then only eliminate known problems and to make the problem filtering as specific as possible with the assumption that future versions will get it right.
Re: [whatwg] Serving up Theora video in the real world
On Fri, Jul 10, 2009 at 2:46 PM, Gregory Maxwell gmaxw...@gmail.com wrote: On Thu, Jul 9, 2009 at 10:35 PM, Robert O'Callahanrob...@ocallahan.org wrote: var v = document.getElementById(video); if (v.canPlayType v.canPlayType(video/ogg; codecs=vorbis,theora)) { ... } else { ... } should work great. Certainly does in Firefox. It works. Except where it doesn't. It's the where it doesn't that counts. At the moment Safari has issues. Out of two widely used production browsers with HTML5 support, one is broken. Not good odds, but I'm hopeful for the future. It's unfortunate that Safari is broken out of the gate, but realistically hardly anyone is going to be using XiphQT right now. Hopefully Apple will have fixed the bug before too long. Rob -- He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all. [Isaiah 53:5-6]
Re: [whatwg] Serving up Theora video in the real world
On Jul 9, 2009, at 7:46 PM, Gregory Maxwell wrote: On Thu, Jul 9, 2009 at 10:35 PM, Robert O'Callahanrob...@ocallahan.org wrote: 2009/7/10 Ian Fette (イアンフェッティ) ife...@google.com To me, this seems like a great test if canPlayType actually works in practice. In the perfect world, it would be great to do getElementById('video'), createElement, and then canPlayType('video/whatever','theora'). If this simple use case doesn't work, I would ask if it's even worth keeping canPlayType in the spec. var v = document.getElementById(video); if (v.canPlayType v.canPlayType(video/ogg; codecs=vorbis,theora)) { ... } else { ... } should work great. Certainly does in Firefox. It works. Except where it doesn't. It's the where it doesn't that counts. At the moment Safari has issues. Out of two widely used production browsers with HTML5 support, one is broken. Not good odds, but I'm hopeful for the future. Robert's code is a bit buggy; canPlayType returns a string, not a boolean, so it will always appear to say yes. Corrected sample code below. I tested, and the following is tragically broken in Safari 4.0.2 even with XiphQT installed, but works as expected in WebKit nightlies and will very likely work in the next Safari dot release. In Safari 4.0.2 it will always say no, even with XiphQT installed. If you are patient, I would say just use this test and it will work as desired Real Soon. Please note, the 4.0.2 bug is just a bug, and not a design flaw in canPlayType. script var v = document.createElement(video); if (v.canPlayType v.canPlayType(video/ogg; codecs=vorbis,theora) ! = no) { document.write(I CAN HAS OGG); } else { document.write(OH NOES); } /script Regards, Maciej
Re: [whatwg] Serving up Theora video in the real world
On Jul 9, 2009, at 9:15 PM, Robert O'Callahan wrote: On Fri, Jul 10, 2009 at 3:04 PM, Maciej Stachowiak m...@apple.com wrote: Robert's code is a bit buggy; canPlayType returns a string, not a boolean, so it will always appear to say yes. You're being polite, my code was not a bit buggy, it was completely broken. I've actually made this mistake several times while writing tests recently, so I should have known better. I actually anticipated this problem, and argued strenuously to break canPlayType into two boolean functions, canPlayType and cannotPlayType, but I lost. Hopefully most Web authors are smarter than I am. I think at one point I suggested that canPlayType should return one of boolean false, true or maybe, so that naiive boolean tests would work. Or in any case, make the no option something that tests as boolean false. - Maciej
Re: [whatwg] Serving up Theora video in the real world
On Fri, Jul 10, 2009 at 3:04 PM, Maciej Stachowiak m...@apple.com wrote: Robert's code is a bit buggy; canPlayType returns a string, not a boolean, so it will always appear to say yes. You're being polite, my code was not a bit buggy, it was completely broken. I've actually made this mistake several times while writing tests recently, so I should have known better. I actually anticipated this problem, and argued strenuously to break canPlayType into two boolean functions, canPlayType and cannotPlayType, but I lost. Hopefully most Web authors are smarter than I am. Rob -- He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all. [Isaiah 53:5-6]
Re: [whatwg] Serving up Theora video in the real world
On Thu, 9 Jul 2009, Maciej Stachowiak wrote: On Jul 9, 2009, at 9:15 PM, Robert O'Callahan wrote: I actually anticipated this problem, and argued strenuously to break canPlayType into two boolean functions, canPlayType and cannotPlayType, but I lost. Hopefully most Web authors are smarter than I am. I think at one point I suggested that canPlayType should return one of boolean false, true or maybe, so that naiive boolean tests would work. Or in any case, make the no option something that tests as boolean false. I've changed the API to return instead of no. -- Ian Hickson U+1047E)\._.,--,'``.fL http://ln.hixie.ch/ U+263A/, _.. \ _\ ;`._ ,. Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
Re: [whatwg] Serving up Theora video in the real world
On Thu, Jul 9, 2009 at 9:22 PM, Maciej Stachowiakm...@apple.com wrote: I think at one point I suggested that canPlayType should return one of boolean false, true or maybe, so that naiive boolean tests would work. Or in any case, make the no option something that tests as boolean false. We seem to have wound up with a tristate where one of the states is never used, which is unfortunate. Is it too late now? To recap (off the top of my head): it's hard to say if you can play something because that requires either a validator, or actually playing it, So in addition to 'yes' and 'no', a 'maybe' was added, to say I've heard of the media type and codecs and profiles, so it's worth trying; no promises. But the whole idea of canPlayType is to be a lightweight test do decide what to try playing in advance, so browsers are unlikely to implement a check that involves actually loading and testing the resource. So in practice 'yes' would only be returned in special applications, not for general web resources. 'No' means no, 'maybe' means yes and 'yes' never gets used. It will be confusing either way, but if canPlayType were reverted to a boolean, with a note that true means 'maybe', not 'yes', there would at least be fewer programming errors. But Ian's just replied with a clever compromise. -r
Re: [whatwg] Serving up Theora video in the real world
On Fri, Jul 10, 2009 at 4:40 PM, Ralph Giles gi...@xiph.org wrote: To recap (off the top of my head): it's hard to say if you can play something because that requires either a validator, or actually playing it, So in addition to 'yes' and 'no', a 'maybe' was added, to say I've heard of the media type and codecs and profiles, so it's worth trying; no promises. The way we've implemented in Firefox, we'll return yes if you specify a codecs parameter and we support every codec in your list. So v.canPlayType(video/ogg; codecs=vorbis,theora) returns probably in Firefox 3.5. I think this is reasonable because I believe that, modulo bugs in our implementation, we support the full Theora and Vorbis specs. On the other hand, we will return maybe for v.canPlayType(video/ogg). I think this distinction will be useful. I know it's trickier for H.264 where there are many profiles, but IIRC the codecs parameter is flexible enough to encode profile levels as well. Rob -- He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all. [Isaiah 53:5-6]