Giter VIP home page Giter VIP logo

hasplayer.js's Introduction

DEPRECATED (please use dash.js project)

hasplayer.js Build Status

hasplayer.js is a javascript implementation of a video player based on the W3C premium extensions, i.e. MSE and EME.

hasplayer.js is an extension of the dash.js project with the aim of supporting additional http adaptive streaming protocols such as Microsoft Smooth Streaming protocol and Apple Http Live Streaming.

If your intent is to use the player code without contributing back to this project, then use the MASTER branch which holds the approved and stable public releases.

If your goal is to improve or extend the code and contribute back to this project, then you should make your changes in, and submit a pull request against, the DEVELOPMENT branch.

Learn more about versions and roadmap on the wiki.

Quick Start

Reference Player

  1. Download 'master', 'development' or latest tagged release.
  2. Extract hasplayer.js and move the entire folder to localhost (or run any http server instance at the root of the hasplayer.js folder).
  3. Open any sample from the samples folder in your MSE capable web browser.

Install Dependencies

  1. install nodejs
  2. install gulp
npm install -g gulp

Build / Run

npm run build

The build task can be configured in order to select supported protocol(s) and to integrate or not EME support. For example:

  1. No hls support, no EME support:
npm run build -- --no-hls --no-protection
  1. No hls support, no MSS support:
npm run build -- --no-hls --no-mss

Demo

A builded version of the hasplayer.js and samples is available at this address:

http://orange-opensource.github.io/hasplayer.js

License

All code in this repository is covered by the BSD-3 license. See LICENSE file for copyright details.

Getting Started

Create a video element somewhere in your html. For our purposes, make sure to set the controls property to true.

<video id="videoPlayer" controls="true"></video>

Add hasplayer.js to the end of the body.

<body>
  ...
  <script src="yourPathToHasplayer/hasplayer.js"></script>
</body>

Now comes the good stuff. We need to create an MediaPlayer. Then we need to initialize it, attach it to our "videoPlayer" and then tell it where to get the video from. We will do this in an anonymous self executing function, that way it will run as soon as the page loads. So, here is how we do it:

(function(){
    var stream = {
        url: "http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest"
    };
    var mediaPlayer = new MediaPlayer();
    MediaPlayer.init(document.querySelector("#videoPlayer"));
    MediaPlayer.load(stream);
})();

When it is all done, it should look similar to this:

<!doctype html>
<html>
    <head>
        <title>hasplayer.js Rocks</title>
    </head>
    <body>
        <div>
            <video id="videoPlayer" controls="true"></video>
        </div>
        <script src="yourPathToHasplayer/hasplayer.js"></script>
        <script>
            (function(){
                var stream = {
                    url: "http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest"
                };
                var mediaPlayer = new MediaPlayer();
                mediaPlayer.init(document.querySelector("#videoPlayer"));
                mediaPlayer.load(stream);
            })();
        </script>
    </body>
</html>

DRM Video Stream

In the case of protected content, here is an example illustrating setting of the protection data:

    var stream = {
        url: "<manifest_url>",
        protData: {
            "<key_system>": {
                laURL: "<licenser_url>",
                withCredentials: "<license_request_withCredentials_value (true or false)>",
                cdmData: "<CDM_specific_data>", // Supported by PlayReady key system (using MS-prefixed EME API) only
                serverCertificate: "<license_server_certificate (as Base64 string)>"
                audioRobustness: "<audio_robustness_level>" // Considered for Widevine key system only
                videoRobustness: "<video_robustness_level>" // Considered for Widevine key system only
            }
        }
    };
    mediaPlayer.load(stream);

HLS and FairPlay on Safari/OSx

In order to playback HLS protected contents with FairPlay DRM, a specific mode is available which consists in streaming and playing the content directly with the <video> element, and in managing the exchanges between the FairPlay CDM and the licenser using EME. To activate this mode on Safari/OSx you need to explicitely indicate the protocol type, i.e. 'HLS', for the input stream:

    var stream = {
        url: "<manifest_url>",
        protocol= "HLS",
        protData: {
            "com.apple.fps.1_0": {
                laURL: "<licenser_url>",
                withCredentials: "<license_request_withCredentials_value (true or false)>",
                serverCertificate: "<license_server_certificate (as Base64 string)>"
            }
        }
    };
    mediaPlayer.load(stream);

Since native player is used to achieve streaming session, some parts of the MediaPlayer API have no effect (functions relative to streaming and ABR configuration, DVR, trick mode...). However, API for audio and subtitles tracks management is functional.

Events

MediaPlayer offers events to be notified of differents events on video streaming. Those events are, for a part, sent by the HTMLMediaElement (<video>), and for an other part, sent by the MediaPlayer.

function registerMediaPlayerEvents() {
    // MediaPlayer events
    mediaPlayer.addEventListener("error", onError);
    mediaPlayer.addEventListener("warning", onWarning);
    mediaPlayer.addEventListener("cueEnter", onCueEnter);
    mediaPlayer.addEventListener("cueExit", onCueExit);
    mediaPlayer.addEventListener("play_bitrate", onPlayBitrateChanged);
    mediaPlayer.addEventListener("download_bitrate", onDownloadBitrateChanged);
    mediaPlayer.addEventListener("manifestUrlUpdate", onManifestUrlUpdate);
    mediaPlayer.addEventListener("metricAdded", onMetricAdded);
    mediaPlayer.addEventListener("metricChanged", onMetricChanged);
    mediaPlayer.addEventListener("bufferLevel_updated", onBufferLevelUpdated);
    mediaPlayer.addEventListener("state_changed", onStateChanged);
    // <video> element events
    mediaPlayer.addEventListener("loadeddata", onload);
    mediaPlayer.addEventListener("play", onPlay);
    mediaPlayer.addEventListener("pause", onPause);
    mediaPlayer.addEventListener("timeupdate", onTimeUpdate);
    mediaPlayer.addEventListener("volumechange", onVolumeChange);
};

For instance, callback function looks like this :

function onPlayBitrateChanged(e) {
    handlePlayBitrate(e.detail.bitrate, e.detail.time);
};

Documentation

Full API Documentation is available describing MediaPlayer public methods and events.

This API documentation can be generated using following gulp command:

npm run doc

Tested With

Browser Stack Logo

hasplayer.js's People

Contributors

alepurga avatar eiximenis avatar icodeveloper avatar jeffcunat avatar jeremco avatar josepedrodiassky avatar mariomc avatar mbrechet avatar nicosang avatar onotole avatar sandersaares avatar vaizier-vo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hasplayer.js's Issues

Several typos in README

There are several typos in README.md.

You can also check for other available targter by running:
For exemple: * grunt build -protocol mss -no-protection
A builded version of the hasplayer.js and samples is available ah this address:

MSS linear stream loads only one video fragment

Hi,

we are currently developing a hasplayer based web player for a customer.
We now have a problem with their linear streams in that only the very first video fragment is loaded. Audio loads fine. We also noticed that the video buffer reports it had buffered approx. 2000 seconds of data, almost half an hour. We can not explain as to why this happens. At the moment we are clarifying if we are allowed to share the link to the manifest or parts of it.
The linear stream for "Big buck bunny" from france telecom works. Therefore we can not explain why the other streams don't. I should mention, at the moment it is developed for Chrome browser only.
We would very much appreciate it if you could help us out.

Kind regards

Simon

Multiple m3u8 source urls?

Hi,

Dash.js and html5-video support multiple source urls, but I've been unable to accomplish the same with hasplayer.js. Each .attachSource() triggers a reset().
Anyone have insight?
Thnx!

seekable range for live smooth streaming

Hi,
I am trying to make hasplayer seeking live stream on IE11 according to the DVR information from manifest ( http://2is7server1.rd.francetelecom.com/C4/C4-51_BBB.isml/Manifest ... DVRWindowLength="6000000000"). It seems I can read current time value via video.currentTime as well as using it to seek back and forth a couple of seconds (video.currentTime = video.currentTime + 10). However I am not able to find any apis I could use to find seekable range (start/end). Is there anything provided by MediaPlayer I can use? Thanks

Chrome - PlayReady video error - PSSH Key

Similar to #31 in Chrome with a Play Ready Video file, I get the following error: [BufferController][text] Problem during init segment generation "Cannot read property 'pssh' of undefined" _log @ hasplayer.js:6572

Is the player supposed to work with "normal" PlayReady files on Edge or Chrome?

HLS MANIFEST_ERR_PARSE

Hi,

Could you please tell me what is wrong with my HLS? It was created by Adobe Media Server.

[14:05:03.884][HlsParser] Doing parse. hasplayer.js:7146:21
[14:05:03.885][HlsParser] #EXTM3U

EXT-X-MEDIA-SEQUENCE:220005

EXT-X-ALLOW-CACHE:NO

EXT-X-VERSION:2

EXT-X-TARGETDURATION:8

EXTINF:8,

../../../../hls-live/streams/livepkgr/events/definst/liveevent/trendRobert-liveNum220005.ts

EXTINF:8,

../../../../hls-live/streams/livepkgr/events/definst/liveevent/trendRobert-liveNum220006.ts

EXTINF:8,

../../../../hls-live/streams/livepkgr/events/definst/liveevent/trendRobert-liveNum220007.ts

EXTINF:8,

../../../../hls-live/streams/livepkgr/events/definst/liveevent/trendRobert-liveNum220008.ts

EXTINF:8,

../../../../hls-live/streams/livepkgr/events/definst/liveevent/trendRobert-liveNum220009.ts

EXTINF:8,

../../../../hls-live/streams/livepkgr/events/definst/liveevent/trendRobert-liveNum220010.ts
[14:05:03.886][HlsParser] no stream in HLS manifest hasplayer.js:7134:21
[14:05:03.890][ManifestLoader] Manifest parsing error hasplayer.js:7134:21
ERROR: {"type":"error","data":{"code":"MANIFEST_ERR_PARSE","message":"Failed to parse manifest","data":{"url":"http://192.168.169.125/hls-live/livepkgr/_definst_/liveevent/trendRobert-live.m3u8"}}} dashif.js:28503:1
[14:05:03.892][StreamController] Reset hasplayer.js:7142:21
[14:05:03.893][Error] Code: MANIFEST_ERR_PARSE, Message: Failed to parse manifest, Data: {
"url": "http://192.168.169.125/hls-live/livepkgr/_definst_/liveevent/trendRobert-live.m3u8"

Thanks a lot,
Ropo

MS Edge + PlayReady CDM data (customdata) missing / not passed on

I am testing with MS Edge Browser against a PlayReady Licenser which requires to be pass some CustomData to aquire a valid License.

I was hopefull and tried this

var protdata = {
                'com.microsoft.playready': {
                    customData: 'very very usefull business data'
                }
};

Unfortunelty this did not seem to change the LicenseRequest.

Looking at

and comparing this with the createKeySession() function in ProtectionModel_21Jan2015
it seems that the cdmData is not passed into the createSession() Function.

Since the cdmData was already availabe as an (unused) 3rd argument i tried passing it into the createSession(type, initData, cdmData), but this also did not change the LicenseRequest.

  • No Error or Warning either.

Currently i suspect that the cdmData is not constructed as it should be.

Any help on this matter would be greatly appreciated.

Is HE-AAC (AAC+) supported?

Hello all,

Please, let me know if HE-AAC is supported for playback, because, currently, the player says that the content type is not supported if Smooth Streaming asset contains the HE-AAC audio stream.

Thank you very much.

hasplayer not working in IE11

Hi, I am using hasplayer.js for my html appliation for playing .ismv files and below is the example test file:
http://wams.edgesuite.net/media/MPTExpressionData02/BigBuckBunny_1080p24_IYUV_2ch.ism/manifest

    function setupVideo() {
        debugger;
        var context = new Custom.di.CustomContext();
        var player = new MediaPlayer(context);
        player.startup();
        player.attachView(document.querySelector('#videoplayer'));
        player.setAutoPlay(false);
        player.attachSource('http://wams.edgesuite.net/media/MPTExpressionData02/BigBuckBunny_1080p24_IYUV_2ch.ism/manifest', null, null);

    }

above is the js is working fine in chrome but in IE11 this is not working and error : unknown error occurred message is coming.

Supprot HLS with Playready?

I have a question.
What type of DRM the hasplayer.js is support ?
Is it support Playready?
Thanks for your reply.

Some questions about the player

Hi,

I was searching for an HTML 5 player supporting the smooth streaming, and I finally came across your player. My wish is to replace my silverlight player on chrome, that will not be supported in few month :
http://blog.chromium.org/2014/11/the-final-countdown-for-npapi.html.

I noticed that it is not a final version, and it seems that it's been a long time since you worked on it.

However, I would like to know if It is stable enough to be use in production ?

Are you still working on it, do you plan to do some update ?

If your answer is no on the questions above, do you know another HTML 5 player which support the smooth streaming ?

Thanks a lot in advance for your response.

Regards,
Abel

Audio playback failure on live smooth stream

Hi,
trying to playback a live smooth stream broadcast using Microsoft Expression Encoder the player (Version: 1.2.1_dev_2082efe - 1.7.2015_17:34:15) fails to play the AACL audio track with the following error

Audio Codec (audio/mp4;codecs="undefined") is not supported.

Looking at the manifest we found that the audio track QualityLevel element has an empty FourCC attribute:
QualityLevel PacketSize="4" BitsPerSample="16" SamplingRate="44100" Channels="2" AudioTag="255" FourCC="" CodecPrivateData="1210" Bitrate="64000" Index="0"

The stream is played correctly using a Silverlight player.

TypeError: MediaKeys.isTypeSupported is not a function

I'm trying to play some playready encrypted smooth streaming content that requires customdata, but have not been able to succeed doing this. If I play content from the same server without protection it works fine (in Chrome), but not otherwise.

I've tried both in http://orange-opensource.github.io/hasplayer.js/1.2.0_dev/dashif.html and locally.
I notice the console spits out this error "TypeError: MediaKeys.isTypeSupported is not a function", and it sounds like it might be related, but I'm not sure.

The complete console output can be seen here: http://pastebin.com/rm89kkWC

Any pointers on what I can do to make this work would be very welcome.

Edge + PlayReady - onKeyMessage type === undefined

Found

...
onKeyMessage = function(e) {
        var self = this, licenseMessage = null, keyMessage;
        keyMessage = e.data;
        this.debug.log("[DRM] Key message: type = " + keyMessage.messageType);
       ...
}

prints

[...][DRM] Key message: type = undefined

Looking at the e Argument it seems that e is already the keyMessage Object.

e.type := "keyMessage"
e.message = ArrayBuffer

cannot set licenseserver-URL

An JS error occurs when I try to set the LAURL in Demo-Player (in Chrome, but also in IE & Firefox, Windows 7)
2015-07-21_11h14_29

Usecase: Trying playback of PlayReady encrypted SmoothStream on Google Chrome browser by using Widevine Proxy. but Proxy (LAURL) cannot be set.

Seek to video NOK

Hi,

I manage to play a video with an Akamai secure HD token, adding withCredentials = true to the manifest and fragment request (ManifestLoader & CustomFragmentLoader).

Now, I'm trying to seek to this video, but it fails.
I'm debugging it since two days and I'm blocked. I hope you can help on that, or give me some advise.

Here is the url of the video :
http://catchup-smooth.eurosport.com/eurosport2_france/203_20150416T195635-20150416T205450/manifest.ism/Manifest?hdnea=st=1422443644~exp=1431083644~acl=*~hmac=45d2ddb2427ce9b387250af24823879b46a38da240753961ce597142e27630a1

When i do a seek (video.currentTime = mySeekTime), I can see on the log that the fragment are loaded in background, but the video stay blocked.

For example, when I seek to 150s, it request the fragment up to 165.2

[BufferController][video] loadNextFragment for time: 150
[DashHandler][video] Getting the request for time: 150
[DashHandler][video] getIndexForSegments for time 150
[DashHandler][video] getIndexForSegments, idx = 74
[DashHandler][video] Index for time 150 is 74

[...]

[BufferController][video] loadNextFragment for time: 165.2
[DashHandler][video] Getting the request for time: 165.2
[DashHandler][video] getIndexForSegments for time 165.2
[DashHandler][video] getIndexForSegments, idx = 82
[DashHandler][video] Index for time 165.2 is 82
SegmentTimeline: 163.7 / 3495.8930158
[BufferController][video] ### Load request http://catchup-smooth.eurosport.com/eurosport2_france/203_20150416T195635-2…0416T205450/manifest.ism/QualityLevels(1802000)/Fragments(video=1652000000)
[FragmentLoader][video] Load: http://catchup-smooth.eurosport.com/eurosport2_france/203_20150416T195635-2…0416T205450/manifest.ism/QualityLevels(1802000)/Fragments(video=1652000000)
[FragmentLoader][video] Loaded: http://catchup-smooth.eurosport.com/eurosport2_france/203_20150416T195635-2…0416T205450/manifest.ism/QualityLevels(1802000)/Fragments(video=1652000000) (200, 2ms, 2ms)
[BufferController][video] ### Media loaded http://catchup-smooth.eurosport.com/eurosport2_france/203_20150416T195635-2…0416T205450/manifest.ism/QualityLevels(1802000)/Fragments(video=1652000000)
[BufferController][video] ### Buffer segment from url http://catchup-smooth.eurosport.com/eurosport2_france/203_20150416T195635-2…0416T205450/manifest.ism/QualityLevels(1802000)/Fragments(video=1652000000)
[BufferController][video] Buffering segment
[BufferController][video] ### Buffered video range [0]: 1.5 - 21.5 (150)
[BufferController][video] ### Buffered video range [1]: 149.200011 - 167.2 (150)
[BufferController][video] ### Media segment buffered
[BufferController][video] checkIfSufficientBuffer
[BufferController][video] Buffer level = 17.19999999999999
[BufferController][audio] checkIfSufficientBuffer
[BufferController][audio] Buffer level = 0
[BufferController][video] checkIfSufficientBuffer
[BufferController][video] Buffer level = 17.19999999999999
[BufferController][audio] checkIfSufficientBuffer
[BufferController][audio] Buffer level = 0

And then, it loop indefinitely on checkIfSufficientBuffer and updateBufferLevel.

Regards,
Abel

Composite manifest support

Hello,

First of all, thank you for this amazing work you've done. Now my question, do you plan to add support for Smooth Streaming composite manifests? If you don't, could you give us some orientation to know what should we change (of course, all changes would be contributions to the project).

Playback stops after QuotaExcededError is thrown

During Playback we sometimes get this Error:

DOMException: Failed to execute 'appendBuffer' on 'SourceBuffer': The SourceBuffer is full, and cannot free space to append additional buffers.(…)
* MediaPlayer.dependencies.SourceBufferExtensions.append @ ...

After which the playback stops completely.

Origin seems to be link The thrown Exception causes the catch block link to be executed and the rejection of the Promise and causes the code at link to be executed. Ultimatley calling the doStop() link function to cancel further requests.

The Comment at link seem to indicate that the Playback should not stop.

Browser: Google Chrome 47.0.2526.58 beta

Bug? "piwik" timed out

Yesterday, I was getting timed out every time.

GET http://tv-has.orange-labs.fr/piwik/piwik.js net::ERR_CONNECTION_TIMED_OUT

About drm stream question

How can I gets or sets a string that contains service-specific data to be conveyed to the license server ?
like silverlight LicenseAcquirer.ChallengeCustomData property . Thank you.

subtitle - display and custom ?

hi all,
I have a manifest with some subtitle.
I'd like to display, at first, the subtitles and in a second time to change its colors (text color, background color).
I can't find some functions / help / docs about this...

thanks in advance for any response ;-)

Doesn't build using instructions from README

~/git/hasplayer-js$ grunt build
Loading "Gruntfile.js" tasks...ERROR
>> Error: Cannot find module 'load-grunt-tasks'
Warning: Task "build" not found. Use --force to continue.

Aborted due to warnings.

The instructions from README file are to run grunt build but that doesn't seem to work because the gruntfile.js is looking for 'load-grunt-tasks', which doesn't exist

Update Dash ?

Hi,

I would like to know if you have planned to update to dash 1.3 or 1.4 ?

Thanks.

Regards,
Abel

TTML based subtitles ISOBMFF packaged

Hi,

I'm currently testing your framework for subtitling with the new EBU-TT-D standard.

I actually seen that you have made a quite nice implementation for TTML based subtitles support, especially with TextTTMLXMLMP4SourceBuffer and so on.

I am trying to get my fragmented subtitles working with your player, but unfortunately, A/V is playing correctly but, CC are not displayed.

I am using content packaged by MP4Box with a dashavc264 profile:

MP4Box -dash 10000 -profile dashavc264:onDemand -rap 
counter_video_720.mp4 
counter_audio.mp4 
subtitles-10m-random-length.mp4 
-out manifest-test-dash-10s-subs-rand-dashavc264

With the following MPD:

<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 0.5.2-DEV-rev99-gb44dfd1-master  on 2015-03-18T09:57:20Z-->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500000S" type="static" mediaPresentationDuration="PT0H10M0.00S" maxSegmentDuration="PT0H0M10.00S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011, http://dashif.org/guildelines/dash264">
 <ProgramInformation moreInformationURL="http://gpac.sourceforge.net">
  <Title>manifest-test-dash-10s-subs-rand-dashavc264.mpd generated by GPAC</Title>
 </ProgramInformation>

 <Period duration="PT0H10M0.00S">
  <AdaptationSet segmentAlignment="true" maxWidth="1280" maxHeight="720" maxFrameRate="25" par="16:9" lang="und">
   <Representation id="1" mimeType="video/mp4" codecs="avc1.42c01f" width="1280" height="720" frameRate="25" sar="1:1" startWithSAP="1" bandwidth="514771">
    <BaseURL>counter_video_720_dashinit.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="872-1623">
      <Initialization range="0-871"/>
    </SegmentBase>
   </Representation>
  </AdaptationSet>
  <AdaptationSet segmentAlignment="true" lang="und">
   <Representation id="2" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="44100" startWithSAP="1" bandwidth="65476">
    <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="1"/>
    <BaseURL>counter_audio_dashinit.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="748-1511">
      <Initialization range="0-747"/>
    </SegmentBase>
   </Representation>
  </AdaptationSet>
  <AdaptationSet segmentAlignment="true" lang="und">
   <Representation id="3" mimeType="video/mp4" codecs="stpp" startWithSAP="1" bandwidth="1587">
    <BaseURL>subtitles-10m-random-length_dashinit.mp4</BaseURL>
    <SegmentBase indexRangeExact="true" indexRange="707-1458">
      <Initialization range="0-706"/>
    </SegmentBase>
   </Representation>
  </AdaptationSet>
 </Period>
</MPD>

Thanks for the help.

Update README

Update the README (in fact for testing issue tracker)

hls not playing valid m3u8 playlists

The following m3u8 doesn't play. It shows: 'No streams to play.':
http://orange-opensource.github.io/hasplayer.js/1.2.1/player.html?url=http://playertest.longtailvideo.com/adaptive/oceans/oceans.m3u8

In addition, the following doesn't play:
http://orange-opensource.github.io/hasplayer.js/1.2.1/player.html?url=http://playertest.longtailvideo.com/adaptive/captions/playlist.m3u8

shows error:
[15:44:01.084][HlsParser] no stream in HLS manifest _log @ hasplayer.js:7605error @ hasplayer.js:7661processManifest @ hasplayer.js:17479internalParse @ hasplayer.js:17497customParse @ hasplayer.js:9791onload @ hasplayer.js:8524XMLHttpRequest.send (async)doLoad @ hasplayer.js:8563load @ hasplayer.js:8576load @ hasplayer.js:11248play @ hasplayer.js:5957doAutoPlay @ hasplayer.js:5965attachSource @ hasplayer.js:6191launchPlayer @ player.js:683onLoad @ player.js:703x.Callbacks.c @ player.js:1597x.Callbacks.p.fireWith @ player.js:1640x.extend.ready @ player.js:807q @ player.js:717
hasplayer.js:7605 [15:44:01.144][ManifestLoader] Manifest parsing error. _log @ hasplayer.js:7605error @ hasplayer.js:7661(anonymous function) @ hasplayer.js:8530_rejected @ hasplayer.js:1463(anonymous function) @ hasplayer.js:1486makePromise.when @ hasplayer.js:1372promise.promiseDispatch @ hasplayer.js:1275(anonymous function) @ hasplayer.js:1198onTick @ hasplayer.js:1031
hasplayer.js:7605 [15:44:01.145][StreamController] Manifest loading error.

Note: the two playlists works well in: http://demo.jwplayer.com/stream-tester/

Dijon.js throw an 1061 error on loading the player

Hi,

I'm testing your hasPlayer framework, and I unfortunately run into the following error upon loading:

Error: 1061
    at Object.dijon.System.mapSingleton (dijon.js:300)
    at Object.setup (Context.js:37)
    at Object.setup (DashContext.js:20)
    at Object.dijon.System.injectInto (dijon.js:383)
    at new MediaPlayer (MediaPlayer.js:196)
    at new <anonymous> (main.js:526)
    at d (angular.min.js:34)
    at Object.instantiate (angular.min.js:34)
    at angular.min.js:66
    at angular.min.js:53

capture d ecran 2015-04-02 a 09 58 14

Thanks for the help

Firefox - playback not working

MSE isn't completely opened up yet to the public, but it is quite usable if you disable the white list. DASH.js, for example, works fine in my experience.

HLS playback with hasplayer.js, however, is not working (at least with my test stream). It gets stuck in the buffering stage.

Here's what I've been using:
http://cdn3.viblast.com/streams/hls/airshow/playlist.m3u8

Also remember to test against Mac Firefox as well as PC.

seek in hls doesn't work (and wrong aspect ratio)

start chrome with --disable-web-security (because bipbopall.m3u8 doesn't have CORS; make sure to close all chrome browsers before starting chrome with --disable-web-security)

check url:
http://orange-opensource.github.io/hasplayer.js/1.2.1/player.html?url=http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8

  1. it will start playing the video (and video apsec ratio is wrong; image is distorted)
  2. seek to any position
  3. video will not seek and will show loop of errors

[12:40:24.331][BufferController][video] loadNextFragment failed
hasplayer.js:7617 [12:40:26.333][BufferController][video] Check buffer...
hasplayer.js:7617 [12:40:26.333]Working time is video time: 622.457171
hasplayer.js:7617 [12:40:26.336][BufferController][video] Buffer level = 0 (time:622.457171)
hasplayer.js:7617 [12:40:26.336][BufferController][video] time to end = 1178.542829
hasplayer.js:7617 [12:40:26.338][AbrController][video] Check rules....
hasplayer.js:7617 [12:40:26.341][DownloadRatioRule][video] Checking download ratio rule... (current = 3)
hasplayer.js:7617 [12:40:26.341][DownloadRatioRule][video] DL: 0.193s, Total: 0.491s => calculatedBandwidth: 45839837.06720978
hasplayer.js:7617 [12:40:26.343][InsufficientBufferRule][video] Checking buffer level ... (current = 3, buffer level = 0)
hasplayer.js:7617 [12:40:26.353][DownloadRatioRule][video] SwitchRequest(3, 1)
hasplayer.js:7617 [12:40:26.353][AbrController][video] Request for quality 3, priority = 1
hasplayer.js:7617 [12:40:26.356][AbrController][video] Request for quality 999, priority = 0.5
hasplayer.js:7617 [12:40:26.356][AbrController][video] Set quality: 3
hasplayer.js:7617 [12:40:26.358][AbrController][video] Quality boundaries: [-1,-1]
hasplayer.js:7617 [12:40:26.358][AbrController][video] Bandwidth boundaries: [-1,-1]
hasplayer.js:7617 [12:40:26.363][AbrController][video] Set playback quality: 3
hasplayer.js:7617 [12:40:26.366][BufferController][video] loadNextFragment for sequence number: 2
hasplayer.js:7617 [12:40:26.366][DashHandler][video] Getting the next request => sn = 2
hasplayer.js:7617 [12:40:26.371][BufferController][video] loadNextFragment failed

Problem with buffer cleanup/release (Code: MEDIA_ERR_APPEND_SOURCEBUFFER)

Hello all,

I may have found an issue with buffers. It is simple to replicate. Open the page with your test player (I have used 1.2.6 player's test page) and put this link inside

https://djkxw9frc3oss.cloudfront.net/ss/unencrypted/ed_h264_720p_multiple-audio-tracks/ElephantsDream.ism/Manifest

Play it for 11 minutes or so (till you will see movie credits) then seek back to 5th second, for example (I tried seeking to a black area on the seek bar which is closed to the beginning of the movie). The player stops and gives this error message:

...
[16:12:11.678]

Same happens here. You wait for credits, don't skeep right to them, watch a full movie. Then seek to som 10th or 5th second - player shows buffering animation, buffers content as seen on Networks tab, but playback never starts.

Testing on Windows 10, Chrome (47.0.2526.106 m)

Thank you.

Issues with Base64 encoded values in 1.2.6

Hello,

I'm playing around with 1.2.6 and porting previous player from 1.2.1 to this new release and I have noticed that these lines of code in 1.2.1 are false and in 1.2.6 are true (i.e. the btoa and atob are undefined)

if (undefined === btoa) {
    var btoa = BASE64.encode;
}
if (undefined === atob) {
    var atob = BASE64.decode;
}

This results in btoa becoming BASE64.encode and this method creates wrong Base64 values. To test, take this Uin8Array

var arr = new Uint8Array([34, 108, 58, 142, 214, 53, 79, 38, 147, 249, 93, 97, 85, 57, 72, 44]);

Run it through this function

function bufferToBase64(buf) {
  var binstr = Array.prototype.map.call(buf, function (ch) {
      return String.fromCharCode(ch);
  }).join('');

  var x = BASE64.encode(binstr);
  var z = window.btoa(binstr);
}

And compare X and Z.

What I currently did to fix the issue is changed the following code

if (undefined === this.btoa) {
    var btoa = BASE64.encode;
}
if (undefined === this.atob) {
    var atob = BASE64.decode;
}

to this

var btoa = this.btoa === undefined ? BASE64.encode : this.btoa;
var atob = this.atob === undefined ? BASE64.decode : this.atob;

Please, correct me if I'm wrong. Thank you.

Edge + PlayReady + ProtectionModel detect + customdata

Hi,

I downloaded the last dev version 1.2.7_dev and I tried to play a smooth streaming protected PlayReady.

I was able to reproduce it only after having force the player to use the 21Jan2015 ProtectionModel
(I commented if(window.MSMediaKeys){ return false; } in detect function. Is this the right way to proceed?

Then I tried to send custom data to my licenser. I found a little typing error on main.js in dash-if sample $scope.cmdData = protData ? protData.cdmData : ""; corrected with $scope.cdmData = protData ? protData.cdmData : ""; then when the player perform the license request I cannot see the custom data. I'm expecting a CustomData tag in the challenge. Do you have any idea on this?

Linear MSS stream requests not existing fragments

Hi,

we currently have the issue that sometimes linear streams halt because some fragments could not get loaded. The server responds with HTTP Error "410 - Gone". Comparing the requested fragment with fragments from the manifest one can see that the requested fragment is not found in the manifest. In certain cases the timestamp in the request only differs by 1. For example:
Fragments in Manifest:
<c t="1427010260251981"/>
<c t="1427010280305314"/>
...
Requested timestamp:
1427010260251980

After three consecutive failures, hasplayer gives up and the stream halts.
We tested mostly in Chrome on different OS.

change SessionType value in KeySystem

The Implementation i am currently working on requires the SessionType passed onto the DRM to be changed from temporary to required.

Is there a way to change the value?

If not i would like to propose to add a sessionType option to the protectionData Object that can overwrite the sessionType value in the KeySystem_XYZ.js.

Like this:

var cpData = {
'widevine.alpha.com': {
  laURL: 'http://.....',
  pssh: '...',
  sessionType : 'required', // overwrite or at least try first
},
};

Out of stack space error on String.fromCharCode.apply(null, [ ] ) in ManifestLoader under MS Edge

I could replicate an Out of stack space error on https://orange-opensource.github.io/hasplayer.js/1.2.6/dashif.html
by using this Test Manifest

The Result looks like this

Origin of this Error is this piece of Code in ManifestLoader.js: getDecodedResponseText().

return String.fromCharCode.apply(null, fixedCharCodes) 

A Browser dependent limit of the the size of the array that can be passed to the apply() method
seems to cause the Out of stack space Error.

IE/Edge problem and fix in KeySystem_PlayReady

Hello all,

Just tried testing the playback of PlayReady protected Smooth Streaming asset in IE and Edge and found that in Edge it doesn't play. The reason is the following line (at least for me on Windows 10, Edge 25.10586.0.0)

bytes = new Uint16Array(message.buffer);

in KeySystem_PlayReady function. Changing it to

bytes = new Uint16Array(navigator.userAgent.indexOf("Edge") >= 0 ? message : message.buffer);

Fixed the issue. The reason of the error is that in Edge the message is ArrayBuffer already, but in IE it's Uint8Array. Just thought I'd share.

Issue with player 1.2.6 playready- win10 - edge - Liz Server URL and custom data

Hi
I have a problem with windows 10, Edge 25.1058... and hasplayer 1.2.6
When playing protected content it seems like the player does ignore the Liz Server defined manually.
Somehow it take the "old" out of the manifest ProtectionHeader or content?
Additionally I have problems with the custom data. It seems like they are not submitted.
Is this a bug? Can someone confirm? Don't know if this is edge specific or hasplayer specific

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.