четверг, 16 июня 2016 г.

Кратко о разработке для ТВ-приставок: Roku

Мои заказчики думали, что Roku — это тоже что-то про Android, но всё оказалось не так. У Roku свой отдельный и полный загадок мир.

Roku Home Screen

Первым делом, конечно, хотелось сделать ту же трансляцию. Однако, в документации не обнаружилось об этом вообще ничего. Притом, что YouTube и Netflix, при наличии установленного на Roku своего канала, устройство обнаруживали и на него транслировали. Ладно,— подумали мы,— напишем тогда себе канал, может в процессе что-нибудь и выясним. Да и вообще пригодится.

Для разработки каналов Roku придумали свой язык BrightScript и написали поддерживающий его плагин для eclipse. Язык не особенно приятный, набор функций в стандартной библиотеке не такой большой, но в целом жить можно. Главное, можно отправлять запросы и легко парсить JSON. Дебаггера нет, но есть функция print и дебажная консолька. Довольно удобна функция публикации приватных каналов, которая позволяет по инвайт-коду легко распространять бета-версии.

Конечно, с самого начала нас больше всего интересуют возможности для UI. Есть несколько вариантов.

Стандартные экраны Roku

Стандартные экраны можно немножко кастомизировать (менять цвета, добавлять кое-где кнопки и т.д.), но в целом это довольно жесткие шаблоны. Исключение составляет только roScreen, на котором можно рисовать. Описание экранов размазано по всей документации, это неудобно, так что перечислю их в таблице:

Класс Как выглядит
roPosterScreen
roSpringboardScreen
roParagraphScreen
roGridScreen
roListScreen
roSearchScreen
roKeyboardScreen
roCodeRegistrationScreen
roVideoScreen
roTextScreen
roScreen Здесь можно рисовать на канвасе и создавать более-менее кастомные интерфейсы

Работа с экранами описана в документации и примерах. Общая схема такова:

Sub ShowPosterScreen()
    port = CreateObject("roMessagePort")     ' слушатель событий
    poster = CreateObject("roPosterScreen")  ' экран
    poster.SetMessagePort(port)              ' прицепили к экрану слушатель

    poster.show()                            ' показали экран
    While True                               ' сели слушать
        message = Wait(0, port)              ' получили событие
        If message.isScreenClosed()          ' определили, что случилось
            Exit While                       ' отреагировали
        else if message.isListItemSelected()
            …
        end if
    End While
End Sub

Для примера приложения на стандартных экранах можно посмотреть Vevo или Fullscreen Selects. В последнем, кстати, экран проигрывания сделан явно с помощью roScreen, и довольно хорошо показывает, что с ним можно наворотить.

Scene Graph

Более гибкий способ создания интерфейсов. Здесь уже есть какие-то UI-компоненты и XML-лэйауты. Можно настраивать анимации и красиво переключающиеся панельки, да и работает всё это гораздо более отзывчиво. Подробнее пока писать об этом не буду, так как тема большая и ещё не совсем уложилась у меня в голове. Возможности и примеры кода можно посмотреть в блоге Roku.

Marmalade

Под Roku можно писать игры на Marmalade. Это всё, что я могу сказать по этой теме.

Закрытый SDK

Если открыть тот же YouTube или Netflix, то окажется, что они совсем не похожи на то, что описано в документации. Говорят, что у подобных больших корпораций есть доступ к специальному SDK. Также есть мнение, что на самом деле это всё HTML. В общем, это ещё одна загадка Roku.

Проблемы

Проблема первая. Уже написав какой-никакой работающий канал, я всё ещё не понимаю, как это поможет сделать стриминг, аналогичный Chromecast. YouTube это умеет, а вот Vevo, сделанный на стандартном BrightScript, — нет. Кажется, это тоже фича только для избранных.

Проблема вторая. В нашем приложении есть несколько видео с YouTube. Так вот Roku напрочь отказывается воспроизводить их в хорошем качестве. Проблема известная, обсуждена много где (вот, например, её проявление). Единственное рабочее решение тут — скачивать mp4 на свой сервер, как-то его перекодировать и проигрывать оттуда. Именно так делают упомянутые выше Fullscreen Selects: несмотря на то, что представленные у них видео явно с YouTube, показывают они их, судя по снифферу, со своего CDN.

В общем, Roku полон сюрпризов не хуже Андроида. Хоть разработка канала и не выглядит ничем особенно сложным, завязнуть в ней можно плотно.

62 комментария:

George Luther комментирует...

Don’t worry! If you are facing Roku Activation Error Code 001 issues. It is not a big deal but sometimes it can create a headache for those who are unaware of this activation issue. But Roku Error help is here to help you. You can tell us any problem and issue regarding Roku device; we will provide you an instant solution. You just have to dial Roku helpline numbers UK: +44-800-041-8324 & US/Canada +1-888-480-0288.

George Luther комментирует...

Are you Unable to fix the Roku HDCP Error code 020 as your own? Don't get panic. Just grab your phone and dial the Roku helpline number for instant solutions. Our technical experts are 24/7 available to solve your queries instantly. Get in touch with us.

George Luther комментирует...

Is your device shows Roku Error Code 001 ? Is your Roku device shows activation code? Call us anytime on our toll-free number for instant solution USA/Canada: +1-888-480-0288 & UK: +44-800-041-8324. Go to our website for more information.

George Luther комментирует...

Is your Roku remote not working while you're streaming your Roku device? Don't get panic about your issues. Just talk to our technical experts on our toll-free number USA/Canada: +1-888-480-0288 & UK: +44-800-041-8324. Our technical experts are 24/7 available to solve your queries instantly. Get in touch with us.

John Macchmen комментирует...

Is your device shows Roku error code 018 ? Are you getting frustrated with your Roku device connectivity issue while you're streaming your device? Don't get panic. Just grab your phone and dial Roku helpline number for more information USA/Canada: +1-888-480-0288 & UK: +44-800-041-8324. Go to our website for more information.

Lisa Ashley комментирует...

Echo Dot is one of the best artificial intelligence devices and it can operate many devices on your command. But sometimes it can stop responding to your voice commands. It can happen due to various issues. Alexa Helpline can fix these issues. alexa helpline

Echo Helpline комментирует...

Has your Echo device been unresponsive from a long time? Don’t know the main issue? No problem! Echo Helpline is here to help you. Our team of expert technicians can detect the main problem and fix them in a short span of time. Echo helpline

Geeks For Tech комментирует...

If your home devices or any appliance has stopped working and looking for Geek Squad Support then you have reached to the right place. Geeks for Tech is the best company that can fix your devices in a short span of time. Geek customer service

georgelurther комментирует...

If you are looking for the solution to resolve the canon printer won't connect to wifi
error then get in touch with us. We are a team of dedicated techies who are available at day as well as at night for you. You can take the services anytime according to your wish. To know more check out our website canon printer offline.

ebookhelpline комментирует...

how to update kindle fire? Looking for the solution? Don’t worry we are here to guide you. Our skilled and dedicated team provide kindle services round the clock. So if you are facing any error related to kindle or if you want to know some tips about kindle device then feel free to call at our helpline number i.e. USA/Canada: +1–855–978–6855, UK: +44–800–041–8324 and for more information visit our website kindle help guides.
https://kindlehelpguides.com/how-to-update-kindle/

Echo Helpline комментирует...

Is your Echo device is blinking Red light on it? Don’t know what does it mean and how to fix it? No issue! Echo Helpline is one of the best company that provides you the best troubleshooting and repair service at very affordable price. Echo helpline

Geeks For Tech комментирует...

If you need setup for your smart home, then don’t look further than Geeks for Tech. We have a team of expert technicians and they can fix your smart devices and do setup for your smart home. We are available for you round the clock. Geek customer service

Quickbooks Support Phone Number комментирует...

I read all blogs posted by QuickBooks 24x7 support team and use Quickbooks customer service number too. Reading this piece of the blog will increase your understanding of QuickBooks versions. Be it QuickBooks payroll, QuickBooks desktop, QuickBooks Point of Sale, or any other version; you are sure to get the best information here. This blog is worth reading for every QB user. I can recommend this team and Quickbooks customer service number to call QuickBooks users now. I use it; you should use it too.

Antivirus 24x7 Support комментирует...

Thanks for sharing this type of post It’s really amazing post, this is very useful Blog. I have realized what we can miss if we don’t seek expert’s help for Panda antivirus related queries as soon as we face any issue. You can find Panda antivirus customer support Number.

Unknown комментирует...

Mcafee is known for providing superior quality services to customers at all hours of the day. Our you fail to renew it even after following all the steps. So, get in touch with McAfee Support Phone Helpline Number if you face any difficulty. Call us on toll free number +1 888-309-0939 for further queries.

George Luther комментирует...

Is your device shows Roku Error Code 018 ? Is your Roku device shows a slow speed internet connectivity issue while you're streaming your Roku device? Don't get panic. Just grab your phone and dial Roku helpline number for instant solution USA/Canada: +1-8888-480-0288 & UK: +44-800-041-8324. Our technical experts are 24/7 available to solve your queries instantly. Get in touch with us.

Stella Carlson комментирует...

24*7 Apple Technical Support is leading Apple support website where you get services provider of Apple remote tech support the USA for third party products and services. Contact Apple Support phone number +1-855-516-8225. https://iphone-customerservice.com/macbook-customer-service/

Macbook Customer Service
iTunes Customere service
iPad Customer Service
Apple Customer Service
Technical Help Number
iPhone Customer Service

Lisa Ashley комментирует...

Do you want to add new skills in your Alexa device? Are you unaware of the process of adding new skills in Alexa? Don’t worry! Alex Helpline is the best company that provides you the best guidance and support. We are available for you round the clock. Alexa not responding

Echo Helpline комментирует...

Are you facing registration failure error on your Echo Dot device? If yes, then you have reached to the right place. Echo Helpline is one of the leading companies that provide you the best troubleshooting and repair service for Echo Dot. Alexa Yellow Ring

Geeks For Tech комментирует...

Do you want to get repaired your damaged laser printer from a well-known company? Then don’t look further than Geeks for Tech. Here we will provide you the assured repair service so that you will not get the error or issue again. Geek customer service

Garmin GPS комментирует...

Do you want to activate your Garmin? I know the value of Garmin Map Update and keep reading good content about the same. I found this blog very informative and it increased my understanding about garmin update to a great extent. You can use Garmin Map to get Garmin lifetime maps update or call +1-888-309-0939 for instant help from Garmin GPS experts.

Garmin Nuvi комментирует...

I did not know the entire benefits of Garmin Nuvi Map Update. But since I have read this blog on map update, I have installed all available updates for my garmin device. I must say that this piece of blog has helped me improve navigation experience. I am not suggesting all my friends to read this blog and get Garmin map update with this team. For detailed information, you can contact us at toll-free number +1 888-309-0939 or write at info@garmingpsmapupdate.com. Our Garmin GPS professionals will provide instant help.

John Macchmen комментирует...

Is your device shows the Roku device overheating issue? Are you unable to understand what is going on with your Roku device? Don't get panic. just grab your phone and dial Roku helpline number for instant solution USA/Canada: +1-888-480-0288 & UK: +44-800-041-8324. Our technical experts are 24/7 available to solve your queries instantly. Get in touch with us.

George Luther комментирует...

Is your device shows Roku HDCP Error Code 020 ? Is your Roku device finds out that the HDMI made with your TV is not supporting the copy and content protection technology? Don't get panic. Just talk to our technical experts. Our technicians can help you to solve your queries instantly. Call us on our toll-free number USA/Canada: +1-888-480-0288 and UK: +44-800-041-8324. Go to our website for more information.

John Macchmen комментирует...

Is your device shows the Roku device overheating issue? Are you unable to understand what is going on with your Roku device? Don't get panic. just grab your phone and dial Roku helpline number for instant solution USA/Canada: +1-888-480-0288 & UK: +44-800-041-8324. Our technical experts are 24/7 available to solve your queries instantly. Get in touch with us.

George Luther комментирует...

Are you unable to understand what is Roku Error Code 001 ? Is your Roku device shows activation error? Don't get panic. Call us on our toll-free number for instant solution USA/Canada: +1-888-480-0288 & UK: +44-800-041-8324. Our technical experts are 24/7 available to solve your queries instantly. Get in touch with us.

John Macchmen комментирует...

Is your Roku unable to connect to Wi-Fi? Are you unable to fix Roku Error Code 009 ? Don't get panic. Just talk to our technical experts. They can help you to solve your queries instantly. Call us on our toll-free number USA/Canada: +1-888-480-0288 & UK: +44-800-041-8324. Get in touch with us.

George Luther комментирует...

Are you unable to find IP Address on Roku without Remote? Don't get panic. Just grab your phone and dial Roku helpline number for instant solution USA/Canada: +1-888-480-0288 & UK: +44-800-041-8324. Our technical experts are 24/7 available to solve your queries instantly. Get in touch with us.

John Macchmen комментирует...

Is your Roku device shows overheating issue? Are you unable to fix Roku overheating Problem ? Don't get panic. Just grab your phone and dial Roku helpline number for instant solution USA/Canada: +1-888-480-0288 & UK: +44-800-041-8324.

George Luther комментирует...

Are you getting frustrated with your Roku Error Code 016 ? is your Roku device won't connect to Wi-Fi while you're using your Roku streaming device? Don't get frustrated anymore. Just talk to the technical experts which can help you to solve your queries instantly. Call us on our toll-free number for instant solution USA/Canada: +1-888-480-0288 & UK: +44-800-041-8324. Get in touch with us.

John Macchmen комментирует...

Is your Roku unable to connect to Wi-Fi? Are you unable to fix Roku Error Code 009 ? Don't get panic. Just talk to our technical experts. They can help you to solve your queries instantly. Call us on our toll-free number USA/Canada: +1-888-480-0288 & UK: +44-800-041-8324. Get in touch with us.

George Luther комментирует...

Is your Roku won't connect to Wi-Fi network? Don't get panic. Just simply talk to our technical experts they can provide you online helpdesk services for Roku device issues. Call us on our toll-free number for instant solution USA/Canada: +1-888-480-0288 & UK: +44-800-041-8324. Get in touch with us.

John Macchmen комментирует...

Is your device shows the Roku device overheating issue? Are you unable to understand what is going on with your Roku device? Don't get panic. just grab your phone and dial Roku helpline number for instant solution USA/Canada: +1-888-480-0288 & UK: +44-800-041-8324. Our technical experts are 24/7 available to solve your queries instantly. Get in touch with us.

Roku-comlink комментирует...

If you are watching the video content that doesn’t support HDCP cable, then you will get Fix Roku hdcp error. To get this issue resolved.If AVR port is available on your device, then connect using the HDCP cable.

Aiden Jangra комментирует...

If you make use of HP machines or All-In-One Machines, adjusting the necessary printer settings is imperative. Call HP Support Number to receive comprehensive assistance. If you have doubts about HP printers settings related issues, or any other concern, feel free to discuss with professionals.

George Luther комментирует...

Is your Roku won't connect to Wi-Fi without Remote ? Don't get frustrated with these issue. Just grab your phone and dial Roku helpline number for instant solution USA/Canada: +1-888-480-0288 & UK: +44-800-041-8324. Go to our website for more information.

John Macchmen комментирует...

Is your device shows Roku Error Code 003 ? Are you unable to update your Roku device software issue? Don't get panic. Just grab your phone and dial Roku helpline number for instant solution USA/Canada: +1-888-480-0288 & UK: +44-800-041-8324. Our technical experts are 24/7 available to solve your queries instantly. Get in touch with us.

Job Seeker комментирует...

Here are Government Jobs Latest Update and news; this is the website to come. A lot of articles are available for free reading. Latest Government Jobs in India - Employment News of Central and State Governments, Govt Undertaking, Public Sector, Railway and Bank Jobs in India.

Job in Delhi
Jobs in Mumbai
Jobs in India
Madhya Pradesh
Govt Jobs in Odisha

George Luther комментирует...

Is your device shows Roku Error Code 018 issue? Don't get frustrated anymore. Just grab your phone and dial Roku helpline number for instant solution USA/Canada: +1-888-480-0288 & UK: +44-800-041-8324. Get in touch with us.

John Macchmen комментирует...

Is your device shows Roku Error Code 003 ? Are you unable to update your Roku device software issue? Don't get panic. Just grab your phone and dial Roku helpline number for instant solution USA/Canada: +1-888-480-0288 & UK: +44-800-041-8324. Our technical experts are 24/7 available to solve your queries instantly. Get in touch with us.

George Luther комментирует...

Are you unable to understand what is Roku Error Code 001 ? Is your Roku device shows activation error? Don't get panic. Call us on our toll-free number for instant solution USA/Canada: +1-888-480-0288 & UK: +44-800-041-8324. Our technical experts are 24/7 available to solve your queries instantly. Get in touch with us.

John Macchmen комментирует...

Is your Roku unable to connect to Wi-Fi? Are you unable to fix Roku Error Code 009 ? Don't get panic. Just talk to our technical experts. They can help you to solve your queries instantly. Call us on our toll-free number USA/Canada: +1-888-480-0288 & UK: +44-800-041-8324. Get in touch with us.

Technical Support and Services By Experts комментирует...

Brother printer technical support number Using getting issues or your Printer is not working properly then no worries about it just call our Brother printer technical support phone number +1-888-720-1316 for Tech Support. They are 24/7 available to help you.
Brother printer customer support phone number
Brother printer support phone number

GPS Contact Number комментирует...

Grab the latest Rand McNally GPS Update from the experts of GPS Contact Number. Just dial our 24*7 toll-free number to get latest update or visit our website to know more!

Garmincom.express комментирует...

Hey Guys! Garmin express is an application that helps you out in managing your device and syncing Garmin express with compatible products. This is available for windows and mac computers, it cannot be used in a mobile device or tablet.

Unknown комментирует...


your blog is amazing thanks for sharing. visit the Great Assignment Help site.tbs activate roku

Unknown комментирует...


Your blog is amazing and incredible all information is very informative.roku related inquiry please click.nfl.com/activate/roku

Unknown комментирует...

Your blog is amazing and incredible all information is very informative.Roku related inquiry please click.disneynow activate roku

garmin express комментирует...

Thank for sharing the post if u want more information about gps then visit our website related inquiry please click.garmin express software

Unknown комментирует...


The blog is exceptionally fascinating and extremely comprehended to be perused, might be helpful for the individuals. I needed to thank you for this extraordinary read!!click pogo login issue

garmin express комментирует...

I truly making the most of your blog Thanks for sharing such a useful post. visit the Great Assignment Help site.Web Updater

Garmin.com/express-updates комментирует...

Since it lets you up to date your software, upload actions to Garmin Connect, upgrade your golf class maps, and enroll your products.Garmin express is a unique desktop software that offers the solution under one roof, follow the instructions to setup Garmin express. With the latest updates of Garmin Express Maps, you can without much of a stretch locate the new tracks, way points, and courses in the specific region.

Fubo.tv/Activate комментирует...

Unable to sign in and fubo.tv/connect a prevalent error that many people face when launching their face. are two options to sign-in or login on FuboTV. Before talking about installing and updating the application, let’s look at the devices it supports. You will only be able to fubo.tv/Connect.

techmanoj комментирует...


Roku is a streaming device which is very popular in USA. It provides you 3500 channels. Roku has many free channels and paid channels that pay for monthly subscriptions.

roku.com/linkcode

techmanoj комментирует...



Norton is the best choice available on the market, when it comes to antivirus programs. Despite the world moving down the digital route, millions of people are browsing the Web every day.

norton.com/enroll

techmanoj комментирует...


The Roku Player No.1 is a television platform very common all around the world in the United States. Roku offers the finest content they've ever wanted to offer consumers.

roku com link

techmanoj комментирует...



Norton is an antivirus that protects the system from web viruses and malware. As we know, millions of users come on the Internet every day in today’s environment, which can have both benefits and drawbacks, and to prevent those pitfalls

norton.com/enroll

jacksoncooper комментирует...

How to solve Kindle won’t connect to wifi error quickly? If you want to know the solution to fix this error then get connected with us. We will tell you the actual reason behind this error and provide you with the best solution. To know more check out the website Ebook Helpline.

lucynelson комментирует...

If you are facing canon printer won't connect to wifi error then get connected with our experts. Our team is very experienced and dedicated and are available round the clock to help you. For more information visit the website Printer Offline Error.

Fubotv Activate комментирует...

You can enjoy local channels of sports and entertainment with the highest quality of video resolution.A new feature called ‘4K On Demand’ comes to FuboTV Connect Code, which will help you browse exclusive 4k videos and channels. To choose this feature, just click on Fubo.tv/Activate and tap on the ‘4K on Demand’option.

GPS Contact Number комментирует...

Are you looking to Update Garmin Nuvi 255w Maps Free? If Yes, then your search is over now. GPS Contact Number, offer Nuvi 255w updates for GPS. Just dial our 24*7 toll-free numbers or feel free to visit our website to know more!

Latest Govt Jobs in India комментирует...

Get free notification of all India Government Jobs 2020 and its job vacancies across sectors in India like Railways, Banking Employment in India, Universities, College Govt Jobs, Teaching, Schools in India, Financial Institutions 2020, Defence, SSC, Agriculture and many more India Government Jobs. Visit: https://www.governmentjobseeker.com/ Police Defence Job Sarkari Jobs for 12th