Added video support.

parent a98aa0db
......@@ -18,6 +18,7 @@
A70634BC1A63114200A75BC0 /* SetupStepTwoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70634BA1A63114200A75BC0 /* SetupStepTwoViewController.swift */; };
A70BDFAA1B7F6199000F47CC /* IndieURLSchemeHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70BDFA91B7F6199000F47CC /* IndieURLSchemeHandler.swift */; };
A70DA5E61B24DCAB00C9CB35 /* NativeNotification.swift in Sources */ = {isa = PBXBuildFile; fileRef = A70DA5E51B24DCAB00C9CB35 /* NativeNotification.swift */; };
A70DF6A91B94F5770093F381 /* folder@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A70DF6A81B94F5770093F381 /* folder@2x.png */; };
A7296C031AA337EF00D64CDA /* Vertical tab bar component.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7296C021AA337EF00D64CDA /* Vertical tab bar component.swift */; };
A7296C101AA337F900D64CDA /* Active-Section-Indicator-Template.png in Resources */ = {isa = PBXBuildFile; fileRef = A7296C041AA337F900D64CDA /* Active-Section-Indicator-Template.png */; };
A7296C111AA337F900D64CDA /* Active-Section-Indicator-Template@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A7296C051AA337F900D64CDA /* Active-Section-Indicator-Template@2x.png */; };
......@@ -169,6 +170,7 @@
A70634BA1A63114200A75BC0 /* SetupStepTwoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = SetupStepTwoViewController.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
A70BDFA91B7F6199000F47CC /* IndieURLSchemeHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = IndieURLSchemeHandler.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
A70DA5E51B24DCAB00C9CB35 /* NativeNotification.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = NativeNotification.swift; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
A70DF6A81B94F5770093F381 /* folder@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "folder@2x.png"; sourceTree = "<group>"; };
A7296C021AA337EF00D64CDA /* Vertical tab bar component.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "Vertical tab bar component.swift"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
A7296C041AA337F900D64CDA /* Active-Section-Indicator-Template.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Active-Section-Indicator-Template.png"; sourceTree = "<group>"; };
A7296C051AA337F900D64CDA /* Active-Section-Indicator-Template@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Active-Section-Indicator-Template@2x.png"; sourceTree = "<group>"; };
......@@ -712,6 +714,7 @@
A7E7D7BC1A616B2A003501C1 /* Assets */ = {
isa = PBXGroup;
children = (
A70DF6A81B94F5770093F381 /* folder@2x.png */,
A7A9C16F1B78AA780046B1C5 /* friend-placeholder.png */,
A7A9C1701B78AA780046B1C5 /* friend-placeholder@2x.png */,
A7499B161AB4B47000B85BFB /* balloon_512x512@2x.png */,
......@@ -934,6 +937,7 @@
A78DAE841A7FCADD009FDB15 /* laura.jpg in Resources */,
A7296C151AA337F900D64CDA /* Conversations-Template@2x.png in Resources */,
A74F4BC21B2D40A20017B16B /* useLocalServers in Resources */,
A70DF6A91B94F5770093F381 /* folder@2x.png in Resources */,
A7296C101AA337F900D64CDA /* Active-Section-Indicator-Template.png in Resources */,
A7499B171AB4B47000B85BFB /* balloon_512x512@2x.png in Resources */,
A78DAE861A7FCADD009FDB15 /* laura-and-osky.jpg in Resources */,
......
......@@ -153,8 +153,22 @@ class MessageSplitViewController: NSSplitViewController
// Remove redundant empty lines.
indexHTML = indexHTML.stringByReplacingOccurrencesOfString("<p><br></p>", withString: "")
// Handle video links (m4v only at the moment)
let matches = indexHTML.matchWithRegex("<object.*? data=\"(.*?\\.m4v)\">.*?</object>")
if matches.count > 0
{
// Found a video link
println("Found a video link.")
if let objectTag = matches[0] as? String
{
var videoTag = objectTag.stringByReplacingOccurrencesOfString("<object data=\"", withString: "<video controls src=\"")
videoTag = videoTag.stringByReplacingOccurrencesOfString("</object>", withString: "</video>")
indexHTML = indexHTML.stringByReplacingOccurrencesOfString(objectTag, withString: videoTag)
}
}
// Change objects to links
indexHTML = indexHTML.stringByReplacingOccurrencesOfString("<object data=\"", withString: "<a href=\"download://\(CurrentPerson.sharedInstance.accountHandle!)")
indexHTML = indexHTML.stringByReplacingOccurrencesOfString("<object data=\"", withString: "<a class='attachment' href=\"download://\(CurrentPerson.sharedInstance.accountHandle!)")
indexHTML = indexHTML.stringByReplacingOccurrencesOfString("</object>", withString: "</a>")
//
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment