Properly render html-like markup contained in video transcripts

Description

  1.  

    1.  

      1. Description

When playing a video which has a transcript that contains certain formatting tags in the attached SRT files, the tags are displayed verbatim in the app without the proper styling being applied (unlike the web site which displays them correctly).

These tags are just basic style tags borrowed from HTML, see: https://en.wikipedia.org/wiki/SubRip#Formatting.

**Note: this is just an initial prototype to get the discussion out there. I don't even have a Mac handy to test this until tomorrow, so I wrote it in vim...pardon any formatting errors or failed CI builds... **

[LEARNER-](https://openedx.atlassian.net/browse/LEARNER-)

My proposal is that we utilize the convenience that UIKit's `NSAttributedString` provides by initializing it with raw data, specifying a `DocumentType` of `.html`, and get the basic bold / italic / etc styling for free.

I noticed that we basically only branch on highlighted text vs not-highlighted text, and that's as far as styling goes. Maybe we can modify `[OEXTextStyle](https://github.com/edx/edx-app-ios/blob/781cd676e23cfd49d78c7511304678df746c0b5c/Source/OEXTextStyle.h)` to take an `NSAttributedString` to sanitize however it likes.

The other option is to strip out these tags completely in `[TranscriptParser](https://github.com/edx/edx-app-ios/blob/ea5a634595155ee46ba7ec7b2c10e1cc0b62cb44/Source/TranscriptParser.swift)`, but that seems like more work and a more invasive change.

cc @marcotuts @saeedbashir Please let me know your thoughts on which approach seems best aligned with edX for the product.

  1.  

    1.  

      1. Screenshots

![SRT-tags](https://user-images.githubusercontent.com/1342396/57374726-d9d51200-719b-11e9-824f-d3280c05db0f.png)

  1.  

    1.  

      1. How to test this PR

You will need to play a video that has a transcript file (.SRT) associated with it that contains these tags. Once we decide the approach, I can update the testing steps.

  •  

    • Reviewers**

  • [ ] @pomegranited

  • [ ] edX reviewer[s] TBD

Assignee

Saeed Bashir

Reporter

Open Source Pull Request Bot

Contributor Name

Tyler Powers

Repo

edx/edx-app-ios

Customer

Epic Link

None

OSCM Assignee

None

Platform Map Area (Levels 1 & 2)

Learner Experiences - Course Experience

Platform Map Area (Levels 3 & 4)

None

Blended Hour Utilization Percentage

None

Story Points

1

Priority

Unset
Configure