<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Pause Test</title>
<script src="//player.ooyala.com/v3/7267438d470c471eb75a165a8b670617?platform=html5-priority"></script>
</head>
<body>
<div id="container" style="width:640px;height:360px"></div>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Script (requires node 6+) | |
const fetch = require('node-fetch'); | |
const baseURL = 'http://player.ooyala.com'; | |
const pcode = 'BtbmUyOlamRiH-S0S-iUeNvf_ghr'; | |
const embedCode = 'tzNDI1NzE6gt3qQPR46SU5yi9lDEYLRJ'; | |
const queryString = 'device=html5&domain=comment.my-demo.link'; | |
const requestURL = `${baseURL}/sas/player_api/v1/authorization/embed_code/${pcode}/${embedCode}?${queryString}`; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OO.ready(() => { | |
const player = OO.Player.create('container', '{embed_code}', playerParam); | |
if (OO.isSmartTV) { | |
player.mb.subscribe(OO.EVENTS.BITRATE_CHANGED, 'example', () => { | |
setHighestQuality(player); | |
}); | |
} else { | |
player.mb.subscribe(OO.EVENTS.BITRATE_CHANGED, 'example', () => { | |
avoidHighestQuality(player); | |
}); |
<script>
OO.ready(function() {
OO.Player.create('container', 'content's embed_code', {
onCreate: function (player) {
player.mb.subscribe(
OO.EVENTS.ERROR,
'drm-test',
function (event, error) {
if (error.code === 'faxsDrmError') {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>test</title> | |
<script src="ua-parser.min.js"></script> | |
<script src="swfobject.js"></script> | |
<script src="//player.ooyala.com/v3/{YOUR-PLAYER-ID}"></script> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import datetime | |
import json | |
import urllib | |
import httplib | |
import hashlib | |
import base64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Ooyala Standalone IQ demo</title> | |
<script src="//analytics.ooyala.com/static/analytics.js"></script> | |
</head> | |
<body> | |
<div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sha256 = require('sha256'), | |
config = require('config'); | |
function serialize(params, delimiter) { | |
return Object.keys(params).sort() | |
.map(function (key) { | |
return key + '=' + (params[key] !== void 0 ? params[key] : options[key]); | |
}).join(delimiter); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```js | |
OO.ready(function() { | |
var container, video; | |
OO.Player.create('ooyalaplayer', 'ptb2kzeToiFcfXe7n-7ufBdcYVQWupMm', { | |
onCreate: function (player) { | |
player.mb.subscribe('preloadStream', 'example', function(eventName) { | |
if (!video) { | |
return; | |
} |
Japanese translation from the original post in English.
原文: [Getting Literal With ES6 Template Strings by Addy Osmani] (http://updates.html5rocks.com/2015/01/ES6-Template-Strings)
#ES6のテンプレート文字列
従来のJavaScriptの文字列処理はPythonやRubyに比べて非力でしたが、ES6のテンプレート文字列はこの状況を根本的に覆します。(テンプレート文字列はChrome 41からサポートされています。)それによりプログラマはドメイン固有言語(domain-specific language、DSL)を定義する事が可能になります。以下はテンプレート文字列が提供する機能です。
- 文字列の挿入
- 式を文字列に埋め込む