├── .gitignore ├── LICENCE ├── README.md ├── doc ├── 10_event.jpg ├── 1_Start.png ├── 2_VideoInfo.png ├── 3_VideoPlay.png ├── 3rdpartycontent.md ├── 4.0_SubtitlesInfo.png ├── 4_SubtitlesPlay.png ├── 5_SubtitlesFin.png ├── 6_EngineerView.png ├── 7.0_LiveCategory.png ├── 7_LivePlay.png ├── 8_Live.png ├── 9_ad_insert.png ├── dasher.md ├── datamodel.md ├── engineer_view.gif ├── installation_testing.md ├── integration.md ├── live.gif ├── navigation_info.gif ├── open_test.gif ├── refapp_test.txt ├── subtitles.gif ├── tabs.png └── walkthrough.md ├── src ├── capabilities_ex.xml ├── capabilities_ex2.xml ├── catalogue │ ├── application.js │ ├── config-template.json │ ├── gridcolumn.js │ ├── gridscrollview.js │ ├── gridview.js │ ├── gridviewbox.js │ ├── icons │ │ ├── icon_viewallvideos.png │ │ ├── icons_1x1_1080p-cbcs.png │ │ ├── icons_1x1_1080p.png │ │ ├── icons_1x1_2160p-cbcs.png │ │ ├── icons_1x1_2160p-eac3.png │ │ ├── icons_1x1_2160p.png │ │ ├── icons_1x1_catchup.png │ │ ├── icons_1x1_checkinternet.png │ │ ├── icons_1x1_delete.png │ │ ├── icons_1x1_funny.png │ │ ├── icons_1x1_in-band-events.png │ │ ├── icons_1x1_in-band-subtitle.png │ │ ├── icons_1x1_insert-ad.png │ │ ├── icons_1x1_livestream.png │ │ ├── icons_1x1_localstorage.png │ │ ├── icons_1x1_multipleaudio.png │ │ ├── icons_1x1_out-of-band-subtitle.png │ │ ├── icons_1x1_reload.png │ │ ├── icons_1x1_wrench.png │ │ └── icons_1x2_catchup.png │ ├── images │ │ ├── bg_gridViewBox_before.png │ │ ├── bg_gridViewBox_span.png │ │ ├── bg_itemDescription.png │ │ ├── bg_wrapper.png │ │ ├── icons.png │ │ ├── logo_hbbtv.png │ │ └── logo_sofia.png │ ├── index.php │ ├── index_html5.php │ ├── index_mse-eme.php │ ├── index_oipf.php │ ├── log │ │ └── save.php │ ├── menu.css │ ├── menu.js │ ├── navigation.js │ ├── resources.php │ ├── topmenu.js │ ├── topmenuitem.js │ └── unsupported.html ├── common.css ├── common.js ├── common2.js ├── debugscreen.css ├── debugscreen.js ├── dialog.css ├── dialog.js ├── getAds.php ├── getSubs.php ├── icons │ ├── arrow_down.png │ ├── arrow_left.png │ ├── arrow_right.png │ ├── arrow_up.png │ ├── ff.png │ ├── ff_active.png │ ├── icon_empty.png │ ├── icon_play.png │ ├── icon_prev_next.png │ ├── loading.gif │ ├── rew.png │ ├── rew_active.png │ ├── vcrbtns.png │ └── vcrbtns_active.png ├── index.html ├── jquery-1.11.3.min.js ├── keycodes.js ├── log.js ├── log.php ├── log │ └── .placeholder ├── profiles.json └── videoplayer │ ├── dash.all.debug.js │ ├── dash.all.min.js │ ├── images │ ├── loading.gif │ ├── loading_anim.png │ ├── player_sprite.png │ ├── player_sprite_focused.png │ └── player_sprite_selected.png │ ├── monitor │ └── monitor-base.js │ ├── videoplayer_basic.js │ ├── videoplayer_html5.js │ ├── videoplayer_mse-eme.js │ ├── videoplayer_oipf.js │ └── vplayer.css └── tools ├── README.md ├── editor ├── app.js ├── app_style.css ├── index.html └── saveConfig.php ├── java ├── .classpath ├── .gitignore ├── .project ├── .settings │ └── org.eclipse.jdt.core.prefs ├── WidevineCencHeaderProto.proto ├── build.xml ├── dasher.properties ├── lib │ ├── Roboto-Regular.ttf │ ├── isoparser-1.9.30.jar │ ├── jaxb-api-2.3.1.jar │ ├── protobuf-java-3.3.0.jar │ ├── protobuf-java-util-3.3.0.jar │ ├── slf4j-api-1.7.25.jar │ └── slf4j-nop-1.7.25.jar ├── readme.txt └── src │ ├── META-INF │ └── MANIFEST.MF │ ├── com │ └── google │ │ └── protobuf │ │ └── object │ │ └── WidevineCencHeaderProto.java │ └── org │ └── hbbtv │ └── refapp │ ├── BoxModifier.java │ ├── DashDRM.java │ ├── DashManifest.java │ ├── Dasher.java │ ├── DasherImage.java │ ├── DasherImageAtlas.java │ ├── DasherManifest.java │ ├── DasherMultiPeriod.java │ ├── EventInserter.java │ ├── JSONUtil.java │ ├── LogWriter.java │ ├── MediaTools.java │ ├── MediaTools2.java │ ├── StreamSpec.java │ ├── SubtitleInserter.java │ ├── Utils.java │ ├── WidevineTool.java │ └── XMLUtil.java └── test ├── DownloadSegments.py ├── ModifyConfig.py ├── RegisterDRM_ExpressPlay.py ├── RegisterDRM_Irdeto.py ├── RegisterDRM_MicrosoftTest.py ├── RegisterDRM_SKM.py ├── common.php ├── download-testvideos.sh ├── laurl_ck.php ├── laurl_pr.php ├── laurl_pr_persist.php ├── laurl_wv.php ├── multiperiod_00llama_h264.json ├── multiperiod_v8.php └── resources ├── sub_eng.xml ├── sub_fin.xml ├── sub_fin2.xml └── tears_of_steel_eng.xml /.gitignore: -------------------------------------------------------------------------------- 1 | ## OS metafiles 2 | .DS_Store 3 | .DS_Store? 4 | .Spotlight-V100 5 | .Trashes 6 | Thumbs.db 7 | 8 | /*.bak 9 | /bak/ 10 | #src/videoplayer/monitor/* 11 | 12 | ## editor sources are on tools/editor subfolder, 13 | ## optional deployment goes to a src/editor UI folder 14 | src/editor/* 15 | 16 | ## copy config-template.json to config.json in a test or first-time deployments, 17 | ## file should not be overwritten in continuous deployments. 18 | src/catalogue/config.json 19 | 20 | src/catalogue/log/*.json 21 | src/catalogue/log/*.txt 22 | src/log/*.json 23 | src/log/*.txt 24 | deploy 25 | out 26 | videos 27 | -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 HbbTV Association 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Reference Video Application 2 | 3 | ## Reference application for online video streaming. 4 | This application is implemented to be a reference video catalogue and player application 5 | for DASH content on HbbTV 1.5 and 2.0.x (and MSE-EME) devices, with various DRM, audio, subtitle and multiperiod tests. 6 | 7 | Application provides test cases and test material done with tools included in [tools] 8 | - DASH Clear content AVC / HEVC 9 | - DRM (Playready, Marlin, Clearkey) including Playready Security Level 3000 and cbcs 10 | - Out-of-Band Subtitles 11 | - Inband subtitles 12 | - Inband CueData 13 | - Audio selection 14 | - Ad insertion (pre-roll and mid-roll) 15 | - Live DASH with multi mood/mdat signaling 16 | - MultiPeriod DASH 17 | 18 | HbbTV Association is happy to accept content contributions to be included in the Reference Application. Please see [3rdpartycontent] for further details. 19 | 20 | The software is under continuous development and licensed with MIT License. 21 | 22 | ## Disclaimer and data collection 23 | 24 | This tool is provided by the HbbTV Association, a cooperation between broadcasters, operators, manufacturers and technology providers worldwide. It is a non-profit association registered in Switzerland, and is as such constrained by competition law which generally forbids coordination of activity, except standardization activity which produces clear benefits for consumers. Therefore, while the provision of this tool has been made to encourage and facilitate standardization around DRM, the HbbTV Association has chosen not to share individual device results with its own members or beyond, to avoid any risk of competitors gaining an advantage through this data. 25 | 26 | When the live instance (refapp.hbbtv.org) is accessed it is logged in the server access log. This log is never analysed unless explicitly requested by HbbTV association to obtain for example data about the diversity of devices running the app. 27 | The access data is tabulated monthly as total visitors, total requests and amount of data transferred. This data is shared in the HbbTV IITF Reference Application status report. No data is ever collected about the results of individual tests run by other people. 28 | 29 | 100% of the test data in the anonymized result sheet (available to HbbTV members) is collected by test engineers of Sofia Digital, using the devices in the test laboratory of Sofia Digital. Sofia maintains internal and confidential data about specific models and results, and this data is available to manufacturers in question upon request. Sofia also sends this data periodically to manufacturers to discuss findings and possible bugs in the test materials or specific devices. 30 | 31 | Issues can be reported here in github (PLEASE REMEMBER TO ASSIGN YOUR ISSUE TO JUHA JOKI) or you may send email to hbbtv_refapp@sofiadigital.com for any problems or questions. 32 | 33 | ### Usage, testing, installation, integration: 34 | 35 | - Test latest stable version of the application at https://refapp.hbbtv.org/production/catalogue/index.php (see versions for more info) 36 | - Follow [installation] guide to get source and set up local version 37 | - Read API documentation: https://meridian.sofiadigital.fi/tvportal/referenceapp/doc/ 38 | - Follow [integration] guide to integrate videoplayer and/or components to different application 39 | - Follow [dasher] guide to use dasher tool to create dash media files 40 | - See [tests] report 41 | 42 | ### Versions 43 | 44 | ## Production (updated April 2023) 45 | - Updated in line with Test Suite, 3 times a year 46 | - HbbTV 2.0.x and 1.5 Playready and Marlin DRM streams 47 | - Also non-DRM streams for reference and MSE/EME (dash.js) player for devices without a suitable native player 48 | - Subtitle and audio stream selection via color buttons 49 | - Live and VOD DASH profiles 50 | - Low latency (multi moof/mdat) Live and VOD DASH 51 | - Security Level 3000 in Playready with recommendation parameter for license acquisition 52 | - CBCS Playready content 53 | - Separate KID values for video and audio in Playready 54 | - Multiperiod DRM and non-DRM tests 55 | - available at https://refapp.hbbtv.org/production/catalogue/index.php 56 | 57 | ## Staging 58 | - Intended for testing of new features considered stable enough 59 | - Will be in line with github repository 60 | - Multi-DRM tests (Playready and Widevine) 61 | - Persistent license tests for native players (MSE-EME coming soon) 62 | - available at https://refapp.hbbtv.org/staging/catalogue/index.php 63 | 64 | ## Testing 65 | - Intended for rolling out new features and signaling 66 | - Now includes Playready persistent license test for OIPF/HTML5 players (native) 67 | - Suitable for early testing and feedback 68 | - available at https://refapp.hbbtv.org/testing/catalogue/index.php 69 | 70 | ### Multi-period DASH content 71 | 72 | - MPD and EMSG events timeline 73 | - transitions between main content (llama drama cartoon) and ad contents (orange test video) 74 | - static and live multiperiod tests 75 | 76 | ## MPEG-2 TS 77 | - Includes AITs with direct links to production and staging instances 78 | - separate links for HbbTV 1.5 and 2.0.x versions 79 | - Version with HTTP links available at https://refapp.hbbtv.org/videos/refapp_10_04_2019.ts (650 MiB) 80 | - Version with HTTPS links available at https://refapp.hbbtv.org/videos/dash-drm_refapp_2023.ts (450 MiB) 81 | 82 | ### Components and modules: 83 | 84 | See components and modules listing at [integration] guide 85 | 86 | ### Catalogue menu structure: 87 | 88 | Mainmenu, submenus, assets and actions are configured in __[config.json]__ file. 89 | 90 | The file can be changed to any endpoint for data to make static menu dynamic. 91 | 92 | Menu structure for the catalogue app should respect used json structure that 93 | is designed to represent a vod catalogue build by mainmenu and submenus. 94 | 95 | Overall menu structure or datamodel is documented here: [datamodel] 96 | 97 | [//]: # (references) 98 | 99 | [tools]: 100 | [integration]: 101 | [installation]: 102 | [datamodel]: 103 | [config.json]: 104 | [dasher]: 105 | [tests]: 106 | [3rdpartycontent]: 107 | -------------------------------------------------------------------------------- /doc/10_event.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HbbTV-Association/ReferenceApplication/91f635bf0a7f6e1fc299a1d8c015a9da94ae7eac/doc/10_event.jpg -------------------------------------------------------------------------------- /doc/1_Start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HbbTV-Association/ReferenceApplication/91f635bf0a7f6e1fc299a1d8c015a9da94ae7eac/doc/1_Start.png -------------------------------------------------------------------------------- /doc/2_VideoInfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HbbTV-Association/ReferenceApplication/91f635bf0a7f6e1fc299a1d8c015a9da94ae7eac/doc/2_VideoInfo.png -------------------------------------------------------------------------------- /doc/3_VideoPlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HbbTV-Association/ReferenceApplication/91f635bf0a7f6e1fc299a1d8c015a9da94ae7eac/doc/3_VideoPlay.png -------------------------------------------------------------------------------- /doc/3rdpartycontent.md: -------------------------------------------------------------------------------- 1 | # Hosting Third Party Streams in the HbbTV DASH-DRM Reference App 2 | 3 | HbbTV is happy to extend its DASH-DRM reference application to include references to streams from others that are relevant to the HbbTV ecosystem. This document captures our expectations for streams to be considered for this. 4 | 5 | - HbbTV needs to be given the following; 6 | * The URL for MPD for each stream (HbbTV is not interested in hosting streams from others, only in referring to streams hosted by others), 7 | * A description of how the provider of the stream is to be credited in the application - name, logo and potentially a longer description or a link to the stream provider's web site. 8 | * A short technical description of the stream - codecs, DRM system(s), packaging as well as any particular unique or special attributes of the stream. Does it test something specific and, if so, what? Bearing in mind a tester may not have english as a first language, provide a clear explanation of what "playing correctly" should look/sound like. 9 | * The stream needs to have been tested and found to work with HbbTV implementations. 10 | * Note 1: For widest HbbTV applicability, the stream needs to work with the native DASH player built into HbbTV TV sets before MSE and EME were introduced. Also TLS 1.3 should not be required. 11 | * Note 2: Working on a Smart TV supporting HbbTV may not be the same as working on an HbbTV implementation as the DASH playback may be different between Smart TV mode and HbbTV mode. 12 | * The stream should have been validated with the DASH-IF validator. 13 | * Any remaining errors reported by the validator should be believed to be errors with the validator and should have been reported in their github repo. 14 | * A mechanism should be provided by which people can report technical issues with the stream, either a contact person or some kind of issue tracking mechanism that is monitored. 15 | 16 | The user interface of our DASH-DRM reference app consists of a number of tabs. Our current idea is to have a tab for third party streams in the style of the current tabs across the top of the screen. This tab would be on the far right hand end of our current tabs. 17 | 18 | ![Tab structure of the Reference Application](tabs.png "Reference Application UI") 19 | 20 | A dedicated tab for streams from a particular company could also be considered if that company would make a significant number of streams available. 21 | -------------------------------------------------------------------------------- /doc/4.0_SubtitlesInfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HbbTV-Association/ReferenceApplication/91f635bf0a7f6e1fc299a1d8c015a9da94ae7eac/doc/4.0_SubtitlesInfo.png -------------------------------------------------------------------------------- /doc/4_SubtitlesPlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HbbTV-Association/ReferenceApplication/91f635bf0a7f6e1fc299a1d8c015a9da94ae7eac/doc/4_SubtitlesPlay.png -------------------------------------------------------------------------------- /doc/5_SubtitlesFin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HbbTV-Association/ReferenceApplication/91f635bf0a7f6e1fc299a1d8c015a9da94ae7eac/doc/5_SubtitlesFin.png -------------------------------------------------------------------------------- /doc/6_EngineerView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HbbTV-Association/ReferenceApplication/91f635bf0a7f6e1fc299a1d8c015a9da94ae7eac/doc/6_EngineerView.png -------------------------------------------------------------------------------- /doc/7.0_LiveCategory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HbbTV-Association/ReferenceApplication/91f635bf0a7f6e1fc299a1d8c015a9da94ae7eac/doc/7.0_LiveCategory.png -------------------------------------------------------------------------------- /doc/7_LivePlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HbbTV-Association/ReferenceApplication/91f635bf0a7f6e1fc299a1d8c015a9da94ae7eac/doc/7_LivePlay.png -------------------------------------------------------------------------------- /doc/8_Live.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HbbTV-Association/ReferenceApplication/91f635bf0a7f6e1fc299a1d8c015a9da94ae7eac/doc/8_Live.png -------------------------------------------------------------------------------- /doc/9_ad_insert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HbbTV-Association/ReferenceApplication/91f635bf0a7f6e1fc299a1d8c015a9da94ae7eac/doc/9_ad_insert.png -------------------------------------------------------------------------------- /doc/dasher.md: -------------------------------------------------------------------------------- 1 | # Reference DASH-DRM Video Application - Dasher tool 2 | 3 | Dasher tool creates dash media files and manifest files. Output folder contains non-encrypted segment files, multidrm segment files and multiple manifest.mpd files for various use cases. 4 | 5 | ## Command line 6 | This is dasher command line to dash input video file, insert EMSG event objects to segment files, insert EMSG element to manifest.mpd files. 7 | 8 | ``` 9 | ## create segments, drm protection and manifest files 10 | java -jar /dasher/lib/dasher.jar config=dasher.properties ^ 11 | input=/videos/video1.mp4 output=/dash/video1/ logfile=/dash/video1/log.txt 12 | 13 | ## insert emsg objects to segment files 14 | java -cp "/dasher/lib/*" org.hbbtv.refapp.EventInserter input="/dash/video1/v1_1.m4s" ^ 15 | scheme="http://hbbtv.org/refapp" value=1a2b3c ts=1 ptd=0 ^ 16 | dur=12 id=1 msg="emsg event id=1" 17 | java -cp "/dasher/lib/*" org.hbbtv.refapp.EventInserter input="/dash/video1/drm/v1_1.m4s" ^ 18 | scheme="http://hbbtv.org/refapp" value=1a2b3c ts=1 ptd=0 ^ 19 | dur=12 id=1 msg="emsg event id=1" 20 | 21 | ## insert esmg xml element to manifest files 22 | java -cp "/dasher/lib/*" org.hbbtv.refapp.EventInserter input="/dash/video1/manifest.mpd" output="/dash/video1/manifest_evtib.mpd" ^ 23 | scheme="http://hbbtv.org/refapp" value="1a2b3c" 24 | java -cp "/dasher/lib/*" org.hbbtv.refapp.EventInserter input="/dash/video1/drm/manifest.mpd" output="/dash/video1/drm/manifest_evtib.mpd" ^ 25 | scheme="http://hbbtv.org/refapp" value="1a2b3c" 26 | ``` 27 | 28 | ## Configuration file 29 | 30 | This is an example of dasher configuration file to create multidrm dash output files. All properties may be overwritten in dasher command line. 31 | 32 | ``` 33 | logfile= 34 | deleteoldfiles=1 35 | deletetempfiles=1 36 | 37 | ## mode(h264|h265), GOP seconds, segment seconds 38 | mode=h264 39 | gopdur=3 40 | segdur=6 41 | 42 | ## Draw overlay text on video stream (0=disable, 1=timestamp) 43 | overlay=1 44 | 45 | ## name size bitrate 46 | video.1=v1 640x360 512k 47 | video.2=v2 1280x720 1500k 48 | video.3=v3 1920x1080 2100k 49 | 50 | ## name samplerate bitrate channels 51 | audio.1=a1 44100 128k 2 52 | 53 | ## subtitles(out-of-band) name lang inputfile 54 | subob.1=sub_fin fin /subs/sub_fin.xml 55 | subob.2=sub_eng eng /subs/sub_eng.xml 56 | 57 | ## subtitles(in-band) name lang inputfile 58 | subib.1=sub_fin fin /subs/sub_fin.xml 59 | subib.2=sub_eng eng /subs/sub_eng.xml 60 | 61 | ## Output preview images taken from given timestamp 62 | image.seconds=15 63 | image.1=320x180 64 | image.2=640x360 65 | 66 | ## multidrm arguments (rng=RandomNumberGenerator) 67 | drm.cenc=1 68 | drm.playready=1 69 | drm.playready.laurl=https://test.playready.microsoft.com/service/rightsmanager.asmx 70 | drm.marlin=1 71 | drm.widevine=1 72 | drm.clearkey=1 73 | drm.kid=0x43215678123412341234123412341236 74 | drm.key=0x12341234123412341234123412341236 75 | drm.iv=rng 76 | 77 | ## Path to executable tools, leave empty to use system-wide default tools 78 | ## ffmpeg=C:/apps/ffmpeg/bin/ffmpeg.exe 79 | ## mp4box=C:/apps/gpac/MP4Box.exe 80 | tool.ffmpeg= 81 | tool.mp4box= 82 | ``` 83 | -------------------------------------------------------------------------------- /doc/datamodel.md: -------------------------------------------------------------------------------- 1 | # Overall menu structure 2 | 3 | Mainmenu, submenus, assets and actions are configured in __[config.json]__ file. 4 | 5 | The file can be changed to any endpoint for data to make static menu dynamic. 6 | 7 | Menu structure for the catalogue app should respect used json structure that 8 | is designed to represent a vod catalogue build by mainmenu and submenus. 9 | 10 | 11 | 12 | JSON Attribute | Definition 13 | ------------ | ------------- 14 | menus | Array containing all the possible menus. menus[0] is always the main menu 15 | menus[0] | First menu is always the main menu. It defines all accessible submenus 16 | menus[i].center | Default focused item index in specific menu 17 | menus[i].title | Title of the menu. (In mainmenu this is displayed as menu title) 18 | menus[i].items | Array containing submenu entries, assets and actions 19 | menus[i].items[j].title | Title of submenu entry, asset, or action 20 | menus[i].items[j].app | item type. 6=DASH content, other values are obsolote/deprecated 21 | menus[i].items[j].submenu | submenu entry (index of subemnu. if submenu is 1 this entry opens menu menus[1] ) 22 | 23 | ```json 24 | { 25 | "menus": [ 26 | { 27 | "center": 1, 28 | "title": "Main", 29 | "items": [ 30 | { 31 | "title": "NoDRM", 32 | "app": 0, 33 | "submenu": 1 34 | }, 35 | ``` 36 | 37 | #### Video asset common attributes and DRM 38 | 39 | JSON Attribute | Definition 40 | ------------ | ------------- 41 | menus[i].items[j].url | Url of playable DASH content 42 | menus[i].items[j].img | Poster image of asset/action item 43 | menus[i].items[j].la_url | License acquisition URL (for DRM content only) 44 | menus[i].items[j].drm | DRM system (playready/marlin/clearkey). (not defined for Clear content) 45 | menus[i].items[j].app | 6= always for DASH content 46 | menus[i].items[j].desc | Description of the asset or action displayed when menu item is focused 47 | menus[i].items[j].profile | Array of profiles in which specific item is supported. Possible values are "html5", "mse-eme" and "oipf". If this is not set, all profiles are supported 48 | 49 | at menus[i].items: 50 | ```json 51 | { 52 | "center": 0, 53 | "title": "DASH PlayReady", 54 | "items": [ 55 | { 56 | "title": "Linear advert insertion", 57 | "url": "videos/02_gran_dillama_1080p_25f75g6sv2/drm/manifest.mpd", 58 | "img": "videos/02_gran_dillama_1080p_25f75g6s/image_320x180.jpg", 59 | "la_url": "https://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(kid:header,sl:2000,persist:false,firstexp:60,contentkey:EjQSNBI0EjQSNBI0EjQSNg==)", 60 | "drm": "playready", 61 | "app": 6, 62 | "desc": "Ads delivered from any ad-server on ad-event time", 63 | "profile" : ["html5", "mse-eme"] 64 | } 65 | ] 66 | } 67 | ``` 68 | #### Ad Breaks definition 69 | 70 | JSON Attribute | Definition 71 | ------------ | ------------- 72 | menus[i].items[j].adBreaks | If set, tells ad insertion positions. For each ad break mandatory attributes are __position__ and __ads__ 73 | menus[i].items[j].adBreaks[k].position | Ad break position in seconds for midroll ad insertion. Special values are __preroll__ and __postroll__ to define adbreak before the content and after the content 74 | menus[i].items[j].adBreaks[k].ads | Number of ads shown on specific ad break 75 | 76 | at menus[i].items: 77 | ```json 78 | { 79 | "center": 0, 80 | "title": "DASH PlayReady", 81 | "items": [ 82 | { 83 | "title": "Linear advert insertion", 84 | "url": "videos/02_gran_dillama_1080p_25f75g6sv2/drm/manifest.mpd", 85 | "img": "videos/02_gran_dillama_1080p_25f75g6s/image_320x180.jpg", 86 | "app": 6, 87 | "desc": "Ads delivered from any ad-server on ad-event time", 88 | "adBreaks" : [ 89 | { "position" : "preroll", "ads" : 1 }, 90 | { "position" : 20, "ads" : 3 }, 91 | { "position" : 40, "ads" : 1 }, 92 | { "position" : 60, "ads" : 3 }, 93 | { "position" : "postroll", "ads" : 1 } 94 | ], 95 | "profile" : ["html5", "mse-eme"] 96 | } 97 | ] 98 | } 99 | ``` 100 | 101 | 102 | #### Out-of-Band subtitle files 103 | JSON Attribute | Definition 104 | ------------ | ------------- 105 | menus[i].items[j].subtitles | Array containing Out-of-Band subtitles 106 | menus[i].items[j].subtitles[k].code | Subtitle language code ISO 639‑2 107 | menus[i].items[j].subtitles[k].src | Source url for subtitling file. getAds.php may be used to prevent possible CORS issues when fetching XML -files from cross domain location 108 | 109 | ```json 110 | { 111 | "title": "Out of band subtitles", 112 | "url": "videos/02_gran_dillama_1080p_25f75g6sv2/drm/manifest.mpd", 113 | "img": "videos/02_gran_dillama_1080p_25f75g6s/image_320x180.jpg", 114 | "app": 6, 115 | "desc": "TTML subtitles", 116 | "subtitles" : [{ 117 | "code" : "eng", 118 | "src" : "../getSubs.php?file=https://meridian.sofiadigital.fi/tvportal/referenceapp/videos/02_gran_dillama_1080p_25f75g6sv2/sub_eng.xml" 119 | }, 120 | { 121 | "code" : "fin", 122 | "src" : "videos/02_gran_dillama_1080p_25f75g6sv2/sub_fin.xml" 123 | }], 124 | "profile" : ["html5", "mse-eme"] 125 | } 126 | 127 | ``` 128 | 129 | [//]: # (references) 130 | 131 | [tools]: 132 | [integration]: 133 | [installation]: 134 | [config.json]: 135 | -------------------------------------------------------------------------------- /doc/engineer_view.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HbbTV-Association/ReferenceApplication/91f635bf0a7f6e1fc299a1d8c015a9da94ae7eac/doc/engineer_view.gif -------------------------------------------------------------------------------- /doc/installation_testing.md: -------------------------------------------------------------------------------- 1 | # Reference DASH-DRM Video Application - Installation and testing 2 | 3 | ## Installation 4 | 5 | #### Server requirements for installation: 6 | * www-server 7 | * PHP 5 or above 8 | * Git 9 | 10 | 11 | #### Cloning repository 12 | Run git clone to accessible location in your test server: 13 | ``` 14 | git clone https://github.com/HbbTV-Association/ReferenceApplication.git 15 | ``` 16 | After that, you can test application at src/catalogue/index.php 17 | ### Content editing 18 | 19 | ##### Generation of own content 20 | 21 | For content creation read about [tools] used for creating assets available in reference installation 22 | 23 | ##### Setting files to application configurarion 24 | 25 | Config.json file has menustructure, which includes mainmenu and submenus that produces grid-boxes to the UI. 26 | In each grid-box menu you can add assets or actions in array "items". 27 | 28 | Example format for ad insertion: Attribute adBreaks shall contain a list of objects, representing individual adBreak. Each adBreak representation shall have *position* in second or special word "preroll" or "postroll" to be set the break in the beginning or in the end of content video. Each adBreak also shall have attribute *ads* to tell how many ads are inserted to specific break 29 | ```json 30 | { 31 | "title": "Linear advert insertion", 32 | "url": "videos/manifest.mpd", 33 | "img": "icons/icons_1x1_insert-ad.png", 34 | "app": 6, 35 | "desc": "Ads delivered from any ad-server on ad-event time", 36 | "adBreaks" : [ 37 | { "position" : "preroll", "ads" : 1 }, 38 | { "position" : 10, "ads" : 3 }, 39 | { "position" : 30, "ads" : 1 }, 40 | { "position" : 60, "ads" : 3 }, 41 | { "position" : "postroll", "ads" : 1 } 42 | ], 43 | "profile" : ["html5", "mse-eme"] 44 | } 45 | ``` 46 | 47 | *Example format for DRM test. "drm" value may be playready/marlin/clearkey* 48 | ```json 49 | { 50 | "title": "Tears of Steel AVC 1080p", 51 | "url": "videos/drm/manifest.mpd", 52 | "img": "videos/image_320x180.jpg", 53 | "la_url": "https://test.playready.microsoft.com/service/rightsmanager.asmx?cfg=(kid:header,sl:2000,persist:false,firstexp:60,contentkey:EjQSNBI0EjQSNBI0EjQSNw==)", 54 | "drm": "playready", 55 | "app": 6, 56 | "desc": "License URL override method" 57 | } 58 | ``` 59 | 60 | Example action item: Clear javascript commands can be set to be evaluated with attribute *eval* 61 | ```json 62 | { 63 | "title": "Check Internet Connection", 64 | "eval": "showInfo( (navigator.onLine )); ", 65 | "app": 0, 66 | "img": "icons/icons_1x1_checkinternet.png" 67 | } 68 | ``` 69 | 70 | Example Out of band subtitles. Mandatory fields for *subtitle* array objects are *code* (language code for file) and *src* (file location). getSubs.php -subtitle proxy is preferred to use if the subtitle file is retreived from different origin server due to CORS issues with video player. 71 | ```json 72 | { 73 | "title": "Out of band subtitles", 74 | "url": "manifest.mpd", 75 | "img": "icons/icons_1x1_out-of-band-subtitle.png", 76 | "app": 6, 77 | "desc": "TTML subtitles", 78 | "subtitles" : [{ 79 | "code" : "eng", 80 | "src" : "../getSubs.php?file=https://different.host/sub_eng.xml" 81 | }, 82 | { 83 | "code" : "fin", 84 | "src" : "sub_fin.xml" 85 | }], 86 | "profile" : ["html5", "mse-eme"] 87 | } 88 | ``` 89 | 90 | ### Setting up to a Channel 91 | 92 | Create service to your playout system, and application for HbbTV 1.5 and above. Set your local installation url to AIT autostart application, or link its URL to existing application to make it accessible 93 | 94 | ### Running tests 95 | 96 | Start application and run tests added to configuration. With blue button you can see application console output. After testing session you can save all console logs to your installation servers cataloque/log/ folder by selecting 'Save Application log' in settings view. 97 | 98 | [//]: # (references) 99 | 100 | [tools]: 101 | [integration]: 102 | [installation]: 103 | [datamodel]: 104 | [config.json]: 105 | -------------------------------------------------------------------------------- /doc/integration.md: -------------------------------------------------------------------------------- 1 | # Reference DASH-DRM Video Application - Integration 2 | 3 | 4 | ### Components and modules: 5 | 6 | General catalogue application to be used for all HbbTV 1.5 or 2.0.1 devices and browsers. 7 | Application tries to determine HbbTV version of the device and use the preferred player. 8 | 9 | src/catalogue/index.php 10 | 11 | VideoPlayerBasic base class that shall be inherited for different videoplayer classes below: 12 | 13 | src/videoplayer/videoplayer_basic.js 14 | 15 | HTML5 version of the application for HbbTV 2.0.1 devices: 16 | 17 | src/catalogue/index_html5.php 18 | 19 | HTML5 video player component: 20 | 21 | src/videoplayer/videoplayer_html5.js 22 | 23 | OIPF AV object version of the application for HbbTV 1.5 devices: 24 | 25 | src/catalogue/index_oipf.php 26 | 27 | OIPF AV object video player component: 28 | 29 | src/videoplayer/videoplayer_oipf.js 30 | 31 | MSE-EME version of the application for target browser Edge: 32 | 33 | src/catalogue/index_mse-eme.php 34 | 35 | MSE-EME video player component: 36 | 37 | src/videoplayer/videoplayer_mse-eme.js 38 | 39 | Resource file management. PHP file to be included in application index file. File will list all the needed js/css resources for the specified application profile HbbTV 1.5, HbbTv 2.0.1, MSE-EME. 40 | For development purposes this generator will set last modified timestamp as an version parameter for all resource files. This ensures a client device should always use a modified file instead cached. 41 | 42 | src/catalogue/resources.php 43 | 44 | Monitor module to implement analytics about use cases of video playback. Monitor can be changed but it must follow the monitor interface. 45 | 46 | Interface included: 47 | src/videoplayer/monitor/monitor-base.js 48 | 49 | Implementation (excluded but may be implemented for differeent analytics systems): 50 | src/videoplayer/monitor/monitor.js 51 | 52 | 53 | 54 | Menu module. Main functionality to maintain menu structure of the catalogue app for video content, actions and submenus. Here is structure [datamodel] documented. 55 | Menu structure for catalogue is configured in configuration file. For real-world application configuration file may be replaced with backend api to produce similar json. 56 | 57 | src/catalogue/menu.js 58 | src/catalogue/[config.json] 59 | 60 | 61 | Navigation. Common keymapping, event listeners and navigation functionality 62 | 63 | src/navigation.js 64 | 65 | Debugscreen and debug-console saving feature. Pressing blue button applications console.log is printed on screen. 66 | There is action option in settings menu to send log on server. Application will inform the log name on screen if succeed. 67 | 68 | * On reference installation, logfiles are saved to folder http://meridian.sofiadigital.fi/tvportal/referenceapp/src/catalogue/log/ 69 | * In local installation make sure php has write permission to folder *src/catalogue/log/* 70 | 71 | naming **log.json**, for example log7.json and so on 72 | 73 | src/debugscreen.js 74 | 75 | 76 | ### Integration 77 | 78 | ##### Use real-world backend with catalogue app, code changes to integrate 79 | 80 | * In **src/catalogue/application.js**, replace **src/config.json** with dynamic backend that produces similar menu structure. 81 | Existing video library backend may be integrated implementing *getter proxy* between client and actual backend, 82 | which shall format the data to be compliant with the cataloque structure 83 | * use **src/getAds.php?breaks=** to use test ad videos, or replace real-world ad-insertion backend to Videoplayer class `getAds()` -method 84 | * use **src/getSubs.php=file** to fetch cross domain subtitling files 85 | 86 | ##### Using videoplayer component in different application 87 | 88 | Dependencies: Include to the application 89 | * **src/videoplayer/videoplayer_basic.js** *(Mandatory always)* 90 | * **src/videoplayer/videoplayer_oipf.js** *(If needed for HbbTV 1.5)* 91 | * **src/videoplayer/videoplayer_html5.js** *(If needed for HbbTV 2.0.1)* 92 | * **src/videoplayer/videoplayer_mse-eme.js** *(If needed for EME application)* 93 | * **src/videoplayer/dash.all.js** *(If mse-eme is used, include also dash-js library)* 94 | * **src/videoplayer/monitor/monitor-base.js** *(Mandatory to be included. may be extended)* 95 | * **src/videoplayer/vplayer.css** *(Common styles for all player versions)* 96 | 97 | Hint: **src/resources.php** may be used to include selected resources in different application 98 | 99 | 100 | #### Video player API 101 | 102 | API documentation here: https://tvportal.sofiadigital.tv/referenceapp/doc/ 103 | 104 | ##### method sequence in different player 105 | 106 | There is some notable differences in player initiation sequence between mse-eme and HbbTV -versions due to dashjs library needs its own sequence to work properly. 107 | Reference application has function `prepareVideoStart()` in **src/catalogue/menu.js** where this sequence is implemented different in case of the player type: 108 | 109 | MSE-EME | HbbTV 1.5 / HbbTV 2.0.1 | Notes 110 | ------------ | ------------- | ------- 111 | .createPlayer(); | .createPlayer(); | 112 | .setAdBreaks(breaks); | .setAdBreaks(breaks); | param *breaks* shall contain a list of ads or set false if no ads used 113 | .setSubtitles(subs); | .setSubtitles(subs); | param *subs* shall contain a list of OOB subtitles or set null if no OOB subtitles are used 114 | .setDRM( drmsystem, la_url );| | if No DRM, call .setDRM( false ); 115 | .sendLicenseRequest(); | | For HbbTV players this is called explicitly later 116 | .player.initialize(