| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 if (cueData->align() == GenericCueData::Start) | 159 if (cueData->align() == GenericCueData::Start) |
| 160 cue->setAlign(ASCIILiteral("start"), IGNORE_EXCEPTION); | 160 cue->setAlign(ASCIILiteral("start"), IGNORE_EXCEPTION); |
| 161 else if (cueData->align() == GenericCueData::Middle) | 161 else if (cueData->align() == GenericCueData::Middle) |
| 162 cue->setAlign(ASCIILiteral("middle"), IGNORE_EXCEPTION); | 162 cue->setAlign(ASCIILiteral("middle"), IGNORE_EXCEPTION); |
| 163 else if (cueData->align() == GenericCueData::End) | 163 else if (cueData->align() == GenericCueData::End) |
| 164 cue->setAlign(ASCIILiteral("end"), IGNORE_EXCEPTION); | 164 cue->setAlign(ASCIILiteral("end"), IGNORE_EXCEPTION); |
| 165 cue->setSnapToLines(false); | 165 cue->setSnapToLines(false); |
| 166 | 166 |
| 167 if (hasCue(cue.get())) { | 167 if (hasCue(cue.get())) { |
| 168 LOG(Media, "InbandTextTrack::addGenericCue ignoring already added cue: s
tart=%.2f, end=%.2f, content=\"%s\"\n", | 168 LOG_INFO(Media, "InbandTextTrack::addGenericCue ignoring already added c
ue: start=%.2f, end=%.2f, content=\"%s\"\n", |
| 169 cueData->startTime(), cueData->endTime(), cueData->content().utf8().
data()); | 169 cueData->startTime(), cueData->endTime(), cueData->content().utf8().
data()); |
| 170 return; | 170 return; |
| 171 } | 171 } |
| 172 | 172 |
| 173 addCue(cue); | 173 addCue(cue); |
| 174 } | 174 } |
| 175 | 175 |
| 176 void InbandTextTrack::addWebVTTCue(InbandTextTrackPrivate* trackPrivate, double
start, double end, const String& id, const String& content, const String& settin
gs) | 176 void InbandTextTrack::addWebVTTCue(InbandTextTrackPrivate* trackPrivate, double
start, double end, const String& id, const String& content, const String& settin
gs) |
| 177 { | 177 { |
| 178 UNUSED_PARAM(trackPrivate); | 178 UNUSED_PARAM(trackPrivate); |
| 179 ASSERT(trackPrivate == m_private); | 179 ASSERT(trackPrivate == m_private); |
| 180 | 180 |
| 181 RefPtr<TextTrackCue> cue = TextTrackCue::create(scriptExecutionContext(), st
art, end, content); | 181 RefPtr<TextTrackCue> cue = TextTrackCue::create(scriptExecutionContext(), st
art, end, content); |
| 182 cue->setId(id); | 182 cue->setId(id); |
| 183 cue->setCueSettings(settings); | 183 cue->setCueSettings(settings); |
| 184 | 184 |
| 185 if (hasCue(cue.get())) | 185 if (hasCue(cue.get())) |
| 186 return; | 186 return; |
| 187 | 187 |
| 188 addCue(cue); | 188 addCue(cue); |
| 189 } | 189 } |
| 190 | 190 |
| 191 } // namespace WebCore | 191 } // namespace WebCore |
| 192 | 192 |
| 193 #endif | 193 #endif |
| OLD | NEW |