EXAMENSARBETE INOM TEKNIKOMRÅDET INFORMATIONSTEKNIK OCH HUVUDOMRÅDET INFORMATIONS- OCH KOMMUNIKATIONSTEKNIK, AVANCERAD NIVÅ, 30 HP STOCKHOLM, SVERIGE 2016

Embedding premium video in social streams

NICOLÒ SOLANO

KTH SKOLAN FÖR INFORMATIONS- OCH KOMMUNIKATIONSTEKNIK Embedding premium video in social streams

NICOLÒ SOLANO

Master’s Degree Project Stockholm, Sweden April 2016

ABSTRACT

igital videos are a sequence of bits encoded in a universal recognized format. Bits are easy to copy, duplicate and reproduce. However, certain videos have a very high financial Dvalue and therefore the respective owners want to protect them according to the Copyright law, in order to acquire the exclusive rights to publish and to reproduce them. Digital Rights Management (DRM) is the technology used nowadays to protect video distribution and to maintain at the same time a complete control over the usage of the owned resources. Another actual phenomenon is the increasing number of social users, in all the different age ranges. Since social networks are moving towards becoming publishing platforms and many allow third party applications and integration, the project aims to achieve a safe and secure integration of DRM protected videos into social media. In fact, as now this kind of videos are accessible only from proprietary applications, after the payment of a subscription. The major challenges that prevent an easy integration of these technologies are represented by the poor APIs offered by social networks and a market fragmentation created by the existence of several DRM systems and Adaptive Bitrate protocols. After an extensive analysis of video streaming technologies and social networks, we chose Facebook as social network of reference and we described both the backend architecture and the frontend requirements of a web application aiming to stream DRM protected videos in Facebook. However, the solution has to face the following impediments: the impossibility to embed DRM technologies in social mobile platforms and to show protected video content directly from the social News Feed. To this extent, we proposed two alternative solutions by looking at the problem from the social network point of view. Finally, in order to evaluate the quality and the utility of the proposed web application, we conducted a user experience test. The results pointed out a diffuse interest and appreciation. However, the two drawbacks mentioned above are perceived as a negative factor. The proposed application results instead portable on all the desktop browsers and on the 90 percent of social mobile platforms.

i

DEDICATIONANDACKNOWLEDGEMENTS

This thesis work is the conclusion of a Double Degree program between Politecnico di Milano and KTH. The whole project has been conducted in the Accedo offices (Stockholm), from September 2015 to February 2016. I want to dedicate the project to all the members of my family: my brother, companion of life with his humor and vitality, and my parents, because I could not have done anything without the love and support that they have never failed to give me. I also want to thank my grandparents who are unique role models and point of reference with their strength and strong values, and my aunts, for the immense affection they have always given me in all these years, since I was a child. All of you contributed to my growth and education, with your example and support, and I am really happy to celebrate this important achievement with you. A special thank goes to all the people from the Accedo office, in which I spent six beautiful months. In particular, I want to thank my technical supervisor Niklas Björkén for his helpfulness and support. I would also like to thank all the professor that I encountered during my academic career in Politecnico di Milano and KTH. In particular, my supervisors Marco Brambilla and Peter Sjödin, who have been a reference point for comparisons and suggestions for my final project. Last but not least, an important thank goes to all my friends, who walked by my side in these years and shared with me wonderful and unique experiences.

iii

TABLEOF CONTENTS

Page

List of Figures ix

1 Introduction 1 1.1 Overview ...... 1 1.2 Motivation ...... 2 1.3 Problem statement ...... 3 1.4 Goals...... 3 1.5 Proposed solution ...... 4 1.6 Methodology description...... 5 1.6.1 Background study ...... 5 1.6.2 Design and implementation ...... 5 1.6.3 Analysis ...... 6 1.7 Thesis outline ...... 6

2 Analysis of Digital Right Management in video distribution7 2.1 Why is DRM important?...... 7 2.2 Functional architecture ...... 8 2.3 DRM system Architecture...... 8 2.4 Different DRM vendors...... 12

3 Background study 15 3.1 Social networks ...... 15 3.1.1 Facebook...... 15 3.1.2 Twitter...... 16 3.1.3 Tumblr...... 17 3.1.4 Google+...... 17 3.2 Adaptive Bitrate streaming...... 18 3.2.1 Background...... 18 3.2.2 Different solutions...... 19 3.3 Relevant standards for integrating DRM and Adaptive Bitrate protocols in HTML5 21

v TABLEOFCONTENTS

3.3.1 CENC...... 22 3.3.2 MSE ...... 23 3.3.3 EME ...... 23 3.4 JSON Web Token ...... 24 3.5 Related work...... 25

4 Proposed solution 27 4.1 Video streaming opportunities in social platforms...... 27 4.1.1 Desktop ...... 27 4.1.2 Mobile ...... 29 4.2 Limitations...... 29 4.3 Proposed solution ...... 30 4.3.1 Facebook as social network...... 30 4.3.2 Video player requirements...... 31 4.3.3 Maintaining the playback status ...... 33 4.3.4 Application use cases ...... 33 4.3.5 Backend architecture ...... 35 4.4 Alternative solutions ...... 38 4.4.1 Improve the default video player ...... 38 4.4.2 Integration of external DRM-capable video players ...... 40

5 Implementation 41 5.1 Phoenix Framework...... 41 5.1.1 Phoenix components...... 42 5.1.2 Plug...... 42 5.1.3 Ecto...... 44 5.2 Data Model...... 44 5.2.1 Database specifications...... 45 5.3 Authentication: Guardian framework...... 46 5.3.1 Guardian’s configurations...... 46 5.3.2 Guardian’s plugs...... 47 5.4 Fluidity...... 48 5.5 Page dispatcher ...... 49 5.6 Video player ...... 49 5.6.1 Desktop ...... 49 5.6.2 Mobile ...... 50

6 Analysis 51 6.1 Portability test...... 51

vi TABLEOFCONTENTS

6.1.1 Results...... 52 6.2 User experience evaluation ...... 52 6.2.1 Data collection ...... 52 6.2.2 User test description...... 53 6.2.3 Data analysis...... 53 6.2.4 Results...... 55 6.3 Discussion ...... 62 6.3.1 Portability...... 62 6.3.2 User experience...... 62

7 Conclusion 65 7.1 Conclusions...... 65 7.2 Future work ...... 66 7.3 Business, ethical and societal aspects...... 67

A Appendix A 69

Bibliography 73

vii

LISTOF FIGURES

FIGURE Page

2.1 Functional architecture of a DRM system...... 9 2.2 Overview of a DRM system architecture...... 11 2.3 DRM systems supported by currently existing devices and platforms...... 13

3.1 High-level view of an Adaptive Bitrate protocol ...... 19 3.2 Principal characteristics of currently existing Adaptive Bitrate protocols ...... 21 3.3 Browsers supporting MSE and EME standards ...... 22 3.4 Communication flow of JWT authentication ...... 25

4.1 Video streaming possibilities on social networks...... 28 4.2 Backend architecture of the proposed solution...... 36

5.1 Entity-Relationship diagram corresponding to the Data Model of the proposed applica- tion...... 44 5.2 Sequence diagram showing how the session fluidity between two concurrent devices is handled ...... 48

6.1 Summary of the information related to the age, sex and profession of the survey respondents...... 55 6.2 Graphical representation of the survey’ s answers related to social networks usage of the respondents ...... 56 6.3 Graphical representation of the survey’ s answers related to the video consumption habits of the respondents...... 57 6.4 Graphical representation of the survey’ s answers related to the utility of the proposed application ...... 58 6.5 Graphical representation of the survey’ s answers related to the quality of the proposed application ...... 59 6.6 Histograms representing the survey’ s answers of the questions used to delineate user profiles, divided by group...... 61

ix

ihu n etitos[ restrictions any without . Overview 1.1 iia ie sasto iayifrainrpeetn ie otn.Bt r ayt copy, to easy are Bits content. video representing information binary of set a is video digital A h ndmn cest ifrn ie cesbeecuieyfo h evc rvdrwebsite provider service the from exclusively accessible in application. video consists or different which account", to "premium access the called demand subscription, so on a a the of to payment credentials the authentication after given protection: are DRM users and authentication user time same the [6]. resources owned the maintain of to usage holders the content over Rights by control Digital used complete of technology use the access-control the if an through only is is content which protection the (DRM), video watch Management handle can to way users current that The guaranteeing charged. distribution, correctly its before [ protected them acquire reproduce be to to to order and in publish law, to Copyright rights the exclusive to according the protect to want obviously owners [ respective rapidly times, growing still of is number it infinite and an them duplicate and reproduce because store, unprotected theoretically intrinsically can video digital everyone make characteristics These store. and transfer we 1.7. and section 1.6 in section thesis in our description of methodology outline our the describe with we conclude Finally 1.5 . section in solution our I oaas rtce ie otn ssre hog h nentb orcl adigat handling correctly by Internet the through served is content video protected Nowadays, adw present we and 1.4 - 1.3 sections in project the of goals the and statement problem the 1.2, hscatrw nrdc h rbe ae yortei rjc.Frt egv an section give in motivations we the First, state project. we Then, thesis 1.1. our section by in domain faced problem problem the of the overview introduce we chapter this n 10 .Hwvr h ie akti ot iloso olr nowadays, dollars of billions worth is market video the However, ]. 3 .Cranvdohv nedavr ihfiaca au hc the which value financial high very a indeed have video Certain ]. 1 10 .Cneunl,tedgtlcnethas content digital the Consequently, ]. I NTRODUCTION

C HAPTER 1 CHAPTER 1. INTRODUCTION

Modern video providers support another important technology called Bitrate Adaptation, which is a technique that allows to adapt the quality of the transferred video to the network capabilities. However, for both DRM and Adaptive Bitrate protocols, the lack of an initial standard led different companies to develop proprietary protocols. Luckily, three important standards has been recently proposed: DASH, which is an Adaptive Bitrate streaming technique [16], EME, which defines a Javascript API enabling web applications to interact with content protection systems [34] and MSE, another javascript API enabling the streaming of fragmented video sources inside a browser [33]. Therefore, it is now possible to natively integrate DRM capable video players into HTML5 and get rid of external plugins, which otherwise would have to be added to video players in order to correctly handle each different DRM implementation. However, key systems and license management are still vendor free. So, what is happening nowadays is that each browser and platform SDK supports only the specific DRM system owned by the respective producer company [11]. In addition, another problem is that DASH standard is not supported by all platform yet.

The following trends lead to a market fragmentation which makes difficult to provide a video player able to stream protected content independently from the underlying platform and it certainly represents one important reason why this feature is not yet supported by social networks.

1.2 Motivation

Nowadays, there exist many service providers offering protected video content. Hence, especially for new companies that want to enter the market, it is difficult to improve their competitive advantage.

By looking at the following statistical research [30], it is possible to notice how fast the number of social network users is increasing worldwide. Surprisingly, not only young generations but also adults are attracted more and more by social platforms, whose usage is becoming universal: millennials and older generations are spending much time on social feed, most often from smartphones and tablets [5]. Furthermore, social networks are moving towards becoming publishing platforms, and many allow third party applications and integration. So, it’s easy to deduct that video service providers would be able to get more customers if their video content could be consumed inside social feeds as well, and consequently they would increase very much the differential advantage with respect to their direct competitors.

Due to the fact that DRM protected content is still completely dissociated from the social world, the purpose of the project is to understand how it is possible to integrate premium video resources into social streams, without loosing the desired level of protection.

2 1.3. PROBLEM STATEMENT

1.3 Problem statement

The problem faced in the thesis is to describe the requirements of an application that aims to integrate a platform independent video player able to stream DRM protected content inside a social network, given the state of the art technologies. In particular, the requirements of the video player are the following:

• Authentication: a user should be able to authenticate himself from the social network, possibly with the same credentials used in the service provider app or website

• Access control: the video player should support DRM allowing the usage of licenses, which guarantee to maintain access control over the owned resources.

• Encryption: the video player should support a key management system, which allow video decryption

• Portability: the video player should be used in all the different devices supported by the considered social networks

• Fluidity: if a user accesses the same video on two different devices, then the playback session should not be interrupted.

1.4 Goals

The goals of this project are the following:

1. Explore the opportunities offered by the current existing social media, with a focus on video streaming

2. Investigate the state of the art technologies adopted in video streaming and the techniques used to secure video distribution

3. Define the backend architecture of a video provider and the video player characteristics of an application aiming to satisfy the requirements listed in the above section.

4. Find out existing limitations of the actual social networks that could prevent the realization of such an application and propose interesting solutions for them.

5. Implement the aforementioned solution

6. Evaluate the proposed solution, analyzing in particular its portability and the perceived user experience

3 CHAPTER 1. INTRODUCTION

1.5 Proposed solution

The initial purpose of the project was to analyse social media in terms of video streaming and to define which is the best way to embed the above described video player. In particular, the video player requires:

• Support of adaptive bitrate protocol

• Support of DRM systems

• Rely on native HTML5 and Javascript technologies

The last choice has been made in order to create a modern solution that does not rely on external plugins such as Flash player and Microsoft Silverlight, since these plugins are being deprecated in the last versions of desktop and mobile browsers. The following limitations came across the social media analysis:

1. It is impossible to embed a DRM-capable video player in any mobile applications of the current existing social networks.

2. The default video players of the current existing social networks do not provide an API in order to handle DRM natively. Therefore, the only way to adopt this technology into a social network is to import an external video player.

3. Only Facebook and Tumblr permit the integration of an external DRM-capable video player on the respective Desktop applications

With that in mind, we selected Facebook as social of reference, due to its higher popularity and its better user experience in terms of video sharing and distribution. Then, we described, implemented and analyzed the requirements of a web application integrated in Facebook that aims to overcome the mentioned impediments. The first key element is the presence of a URI that unequivocally represents each video resource. The second fundamental element is the presence of a Facebook Page, handled by a video provider that wants to publish his protected videos on Facebook. Then, for each video resource, a new post containing the respective URI is published, so that the users visiting the same page can be able to access it. The behavior of our application and the characteristics of the embedded video player are different, depending on the requesting device:

• On desktop browsers, all the requests are redirected to a personalized Facebook Page Tab, where it is possible to embed external code through an