Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / Flash Media Server Developer Center /

Beginning Flash Media Server 4.5 – Part 5: Streaming with OSMF players

by Tom Green

Tom Green
  • tomontheweb.ca

by Joseph Labrecque

Joseph Labrecque
  • josephlabrecque.com

Content

  • Understanding the Open Source Media Framework
  • Working with the Strobe Media Playback component
  • Building a Strobe Media Playback application
  • Where to go from here

Created

10 October 2011

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
Flash Media Server Flash Professional OSMF RTMFP streaming video

Requirements

Prerequisite knowledge

Some previous experience working with Flash Media Server is recommended. Prior knowledge of web design concepts and using HTML to play Flash video online is helpful.

User level

Beginning

Required products

  • Flash Media Server (Download trial)
  • Flash Professional (Download trial)

Sample files

  • fms45_pt05.zip

This article is the fifth in our series of beginning-level tutorials about working with Adobe Flash Media Server 4.5. In this tutorial you'll learn how to use Flash Media Server 4.5 to stream a video through a Strobe Media Playback player—available through the Open Source Media Framework (OSMF).

Here are all of the articles in the series (links will become active as the articles are published):

  • Part 1: Installing Flash Media Server 4.5
  • Part 2: RTMP streaming on-demand video
  • Part 3: RTMP streaming live video
  • Part 4: RTMP streaming audio
  • Part 5: Streaming with OSMF players
  • Part 6: Using HTTP Dynamic Streaming
  • Part 7: Streaming to iOS devices (to come)
  • Part 8: Streaming to Android devices (to come)
  • Part 9: Security features (to come)

Understanding the Open Source Media Framework

Previously you used the FLVPlayback component to stream a video through Flash Media Server 4.5. Although the FLVPlayback component was easy to use, the component created a relatively large SWF file size (approximately 52 KB). To reduce the overall file size, many developers created special video players with slimmed-down versions of the component, writing custom ActionScript functions to make their players work more efficiently. As a result, a myriad of overly complex or basic video players were released—and frustrated developers spent more time attempting to make the player work than concentrating on perfecting the user experience.

This all changed a couple of years ago when Adobe introduced the Open Source Media Framework and Strobe Media Playback component. The term open source means that you can access the Flash and ActionScript source files and customize the code to build your own video player. When you work with OSMF, the SWF file for the video player is hosted on your own HTML server so it's easy to track and update. Additionally, the OSMF project is a work-in-progress, ensuring that it is continually updated to take advantage of the latest features in Adobe Flash Player.

Strobe Media Playback is very easy to use. You can add video content—either streamed through Flash Media Server 4.5 or HTTP—by simply adding the embed code to a web page. No ActionScript programming is required.

It could just be that the combination of Flash Media Server 4.5 and Strobe Media Playback is a dynamic duo when it comes to media streaming. The next section shows you how it works.

Working with the Strobe Media Playback component

When you installed Flash Media Server 4.5 you also installed a Strobe player. To use it, follow these steps:

  1. Download the sample files provided at the beginning of this tutorial. Uncompress the ZIP file and drag the Vultures.mp4 file from the Video folder to the Flash Media Server 4.5/webroot/vod folder.
  2. Navigate to Flash Media Server 4.5/samples/videoPlayer and open the videoplayer.html file in your browser. The Sample Video Player launches, as shown in Figure 1.
Figure 1. The installation of Flash Media Server 4.5 contains a Strobe Media component.
Figure 1. The installation of Flash Media Server 4.5 contains a Strobe Media component.
  1. Change the Stream URL path to rtmp://localhost/vod/mp4:Vultures.mp4. Click the Play Stream button to play the Vultures video.

Follow these steps to play the video through the Strobe Media Player in a web page:

  1. Scroll down to the bottom of the Sample Video page. Locate the Embed Code area shown in Figure 2.
fig03_thumb View larger
Figure 2. Copy the embed code to add the player to an HTML document (click to enlarge).
  1. Select all of the code in the Embed Code field and copy it to the Clipboard.
  2. Open Dreamweaver CS5.5 or any other HTML editor. Create a new HTML document and paste the code between the <body></body> tags.
  3. Save the file as test.html and quit Dreamweaver (or the HTML editor you are using).

Caution: In Step 4 you named the file test.html instead of index.html because the Flash Media Server Start Screen is the index.html file in the webroot folder. If you save a file named index.html to the webroot folder, the new file you create will overwrite the Start Screen.

  1. Navigate to the Flash Media Server 4.5/webroot folder and copy the HTML file to that folder. Open the file in a browser and watch the video play through the Strobe Media Player (see Figure 3).
Figure 3. The test video plays in the browser.
Figure 3. The test video plays in the browser.

Building a Strobe Media Playback application

Now that you know how to work with the Strobe feature, let's explore a more practical use for it. In this section you'll learn how to create an application that uses a copy of Strobe Media Player which resides on your website, rather than in the server installed on your computer.

As we mentioned previously, Flash Media Server applications always exist in their own folder. In this example, you'll create a new application. The primary difference between this exercise and "real life" is that your RTMP path will point to a real live Flash Media Server rather than the webroot folder used in this exercise.

Begin by preparing the project for FMS. Open the Exercise folder in the sample files, locate the folder named StrobemediaPlayback1.5.1-full, and open it.

The folder contains an uncompressed version of the Strobe Media Playback downloaded from the SourceForge website. You'll use the folder named Flash Player 10.1. Although there are a lot of files, as shown in Figure 4, you only need the following three files for this exercise:

  • StrobeMediaPlayback.swf
  • Expressinstall.swf
  • Swfobject.js found in the lib folder
Figure 4. The Strobe Playback Player files.
Figure 4. The Strobe Playback Player files.

Open the Strobe folder located in the Exercise folder. Copy and paste the files to the following locations in the folder:

  • Paste a copy of StrobeMediaPlayback.swf in the swfs folder
  • Paste a copy of expressinstall.swf in the Scripts folder
  • Paste a copy of swfobject.js in the Scripts folder

After locating the copies of these files, drag the Strobe folder to the Flash Media Server 4.5/webroot folder.

After setting things up, you are ready to stream the Vultures.mp4 file you played in the previous exercise:

  1. Open the videoplayer.html file in your browser. Change the video to Vultures.mp4, scroll down and copy the embed code to the Clipboard.
  2. Launch Dreamweaver CS5.5 and open the index.html file in the Strobe folder.
  3. In the Document toolbar click the Code button to display the Code view of the Document window, if it is not already open.
  4. Click once in line 19 and paste the contents of the Clipboard into the code (see Figure 5).
fig05_thumb View larger
Figure 5. Paste the embed code to add the video to an HTML page (click to enlarge).

Next, you'll make a few changes to the code to point it to the Strobe folder. You'll also update the dimensions to play the video at its full size: 854 x 480 pixels.

  1. Locate line 19 in the code. Change the width value to 854 and the height value to 480. Also in line 19, change the ID and name values to Strobe.
  2. Make the same changes between the <embed></embed> tags.
  3. Click once at the end of line 24 and press the Return/Enter key. Add the following line of code:

<param name="allowscriptaccess" value="always">

Add the same line to the <embed> code right after the name="Strobe" setting.

Note: The AllowScriptAccess property is an HTML property of the <object> and <embed> tags that embed a SWF file. It protects an HTML file from a potentially untrusted SWF file by controlling the ability of that SWF file to call JavaScript code in the surrounding HTML file. AllowScriptAccess has three possible values: always , sameDomain , and never . The always value you set in Step 7 enables JavaScript access. Although it is not technically required, we feel it's usually a good idea to add this line to the <object> and <embed> tags.

Your code should resemble Figure 6. If it does, save the changes and quit Dreamweaver.

fig06_thumb View larger
Figure 6. Review the final version of the code and then save the HTML page (click to enlarge).

Move the Strobe folder to the Flash Media Server 4.5/webroot folder. Double-click the index.html file that you just created. The page opens, the video plays, and you get to join in on the hunt for baby vultures (see Figure 7).

Figure 7. The video plays using your copy of Strobe Media Player.
Figure 7. The video plays using your copy of Strobe Media Player.

Where to go from here

In this tutorial, you learned the basics of using OSMF and Strobe Media Playback in a Flash Media Server 4.5 project. To learn more about building FMS applications to play streaming video files, check out the following articles authored by David Hassoun and John Crosby:

  • Live multicast streaming using OSMF
  • Creating a simple multicast video player using OSMF
  • RealEyes OSMF Player Sample – Part 1: Setup and deployment
  • RealEyes OSMF Player Sample – Part 2: Building and configuration
  • RealEyes OSMF Player Sample – Part 3: Skinning and control bar system

In the next tutorial, you'll examine the process of streaming video using HTTP Dynamic Streaming.

Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License+Adobe Commercial Rights

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

More Like This

  • Understanding live DVR – Part 1: Implementing a live DVR player
  • Webcasting live video with Flash Media Live Encoder
  • Explore video content protection measures enabled by Flash Media Interactive Server 3.5
  • Protecting online video distribution with Adobe Flash media technology
  • Beginner's guide to streaming video with Flash Media Server 3.5
  • Dynamic streaming in Flash Media Server 3.5 – Part 1: Overview of the new capabilities
  • Learning Flash Media Server excerpt: Server-side streams
  • Beginner's guide to dynamic streaming with Flash Media Server 3.5
  • Beginner's guide to installing Flash Media Server 3.5
  • Beginner's guide to security features in Flash Media Server 3.5

Tutorials & Samples

Tutorials

  • OSMF video player for AIR for TV using Flash Professional
  • OSMF video player for AIR for TV using Flash Builder
  • Capture, encode, and stream live video over HTTP to Flash and iOS

Samples

  • Best practices for real-time collaboration using Flash Media Server
  • Understanding live DVR – Part 2: Using DVRCast with Flash Media Live Encoder 3
  • Understanding live DVR – Part 1: Implementing a live DVR player

Flash Media Server Forum

More
04/23/2012 FMS Issues
04/23/2012 FMLE 3.2 to FMS 4.5 - Over time the stream delay increases
04/23/2012 Live stream on FMS issues when reaching 1600 concurrent users
04/23/2012 How does main.asc work in signed folder ('live' or 'vod') with FMS4.5?

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement