Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
plinkaSRPOL authored Apr 13, 2022
1 parent 1ae994d commit bfca5ca
Show file tree
Hide file tree
Showing 6 changed files with 247 additions and 0 deletions.
22 changes: 22 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* ! Copyright (c) 2021, Samsung Electronics Co., Ltd


* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:


* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.


* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. */
11 changes: 11 additions & 0 deletions config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns:tizen="http://tizen.org/ns/widgets" xmlns="http://www.w3.org/ns/widgets" id="http://yourdomain/UDPStreamingTizen65" version="1.0.0" viewmodes="maximized">
<tizen:application id="0wyF5AEhGm.UDPStreamingTizen65" package="0wyF5AEhGm" required_version="2.3"/>
<content src="index.html"/>
<feature name="http://tizen.org/feature/screen.size.normal.1080.1920"/>
<icon src="icon.png"/>
<name>UDPStreamingTizen65</name>
<tizen:privilege name="http://tizen.org/privilege/tv.inputdevice"/>
<tizen:profile name="tv-samsung"/>
<tizen:setting screen-orientation="landscape" context-menu="enable" background-support="disable" encryption="disable" install-location="auto" hwkey-event="enable"/>
</widget>
Binary file added css/SamsungOneUI-400.ttf
Binary file not shown.
40 changes: 40 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
! Copyright (c) 2021, Samsung Electronics Co., Ltd
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

@font-face {
font-family: SamsungOneUI;
src: url('../css/SamsungOneUI-400.ttf');
}


body {
top:0px;
left:0px;
position: fixed;
margin: 50px auto;
font-family: SamsungOneUI;

}
42 changes: 42 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!-- ! Copyright (c) 2021, Samsung Electronics Co., Ltd
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. -->


<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" content="Tizen basic template generated by Tizen Web IDE"/>

<title>IPTV App</title>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<script type='text/javascript' src='$B2BAPIS/b2bapis/b2bavplay.js'></script>
<script src="js/main.js"></script>
</head>

<body>
<object id="av-player" style="width:1920px;height:1080px;"type="application/avplayer"></object>
<div id="messagebox" style="top:0px; position:fixed; color:white; background: rgba(50, 200, 200, 0.5)"> </div>
</body>
</html>
132 changes: 132 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
/*
Copyright (c) 2021, Samsung Electronics Co., Ltd
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

var Player = webapis.avplay;
var url = "udp://238.1.1.1:5004";


var listener = {
onbufferingstart: function () {
console.log("buffering start");
},
onbufferingprogress: function (percent) {
messageLogger("buffering progress...");
console.log("buffering progress..");
},
onbufferingcomplete: function () {
messageLogger("buffering complete");
console.log("buffering complete..");
},
oncurrentplaytime: function (currentTime) {
console.log("current playtime :: ", currentTime);
},
onevent: function (eventType, eventData) {
console.log("onevent " + eventType + " data " + eventData);
},
onstreamcompleted: function () {
messageLogger("stream completed..");
console.log("stream completed..");
},
onerror: function (eventType) {
messageLogger("error has occured: ", eventType);
console.log("error has occured.." + eventType);
},
onsubtitlechange: function (duration, text, data3, data4) {
messageLogger("subtitle changed..");
console.log("subtitle changed..");
},
ondrmevent: function (drmEvent, drmData) {
console.log("on drm event..");
}
};

var init = function () {
messageLogger("Press Play Key to play IP Channel: ", url);

document.addEventListener('keydown', function(e) {
switch(e.keyCode){
case 415: //PLAY
startPlayback();
break;
case 413: //STOP
stopPlayback();
break;
default:
console.log('Key code : ' + e.keyCode);
break;
}
});
registerKey();
};


var registerKey = function() {
tizen.tvinputdevice.registerKey("MediaPlay");
tizen.tvinputdevice.registerKey("MediaPause");
tizen.tvinputdevice.registerKey("MediaStop");
tizen.tvinputdevice.registerKey("MediaRewind");
tizen.tvinputdevice.registerKey("MediaFastForward");
};

//Start playback

var startPlayback = function(){
if(Player.getState() == "PAUSED"){
Player.play();
}else {
Player.open(url); //Open player with set URL
Player.setDisplayRect(0, 0, 1920, 1080); //set player size
Player.setListener(listener); //add listeners
Player.setBufferingParam("PLAYER_BUFFER_FOR_PLAY","PLAYER_BUFFER_SIZE_IN_SECOND", 10);
Player.setBufferingParam("PLAYER_BUFFER_FOR_RESUME","PLAYER_BUFFER_SIZE_IN_SECOND", 10);
Player.setTimeoutForBuffering(10000);
Player.prepareAsync(function() {
Player.play(); //start player
messageLogger("Playing: "+url);
});
}
};

//Stop Playback

var stopPlayback = function(){
messageLogger("Stopped");
Player.stop();
Player.close();
};

//show logs on the screen

var messageLogger = function (msg,arg){
var messagebox = document.getElementById("messagebox");
if(arg){
messagebox.innerHTML = msg +" "+ arg;
}else {
messagebox.innerHTML = msg;
}
};

window.onload = init;

0 comments on commit bfca5ca

Please sign in to comment.