<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aliafify</title>
    <description>The latest articles on DEV Community by Aliafify (@aliafify).</description>
    <link>https://dev.to/aliafify</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F841222%2F95b2b2a4-eca0-482f-be2f-c006621a6b79.png</url>
      <title>DEV Community: Aliafify</title>
      <link>https://dev.to/aliafify</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aliafify"/>
    <language>en</language>
    <item>
      <title>streaming error on Peer connection. Uncaught (in promise) DOMException: The play() request was interrupted by a new load request</title>
      <dc:creator>Aliafify</dc:creator>
      <pubDate>Wed, 15 Mar 2023 15:27:20 +0000</pubDate>
      <link>https://dev.to/aliafify/streaming-error-on-peer-connection-uncaught-in-promise-domexception-the-play-request-was-interrupted-by-a-new-load-request-46e1</link>
      <guid>https://dev.to/aliafify/streaming-error-on-peer-connection-uncaught-in-promise-domexception-the-play-request-was-interrupted-by-a-new-load-request-46e1</guid>
      <description>&lt;div class="ltag__stackexchange--container"&gt;
  &lt;div class="ltag__stackexchange--title-container"&gt;
    
      &lt;div class="ltag__stackexchange--title"&gt;
        &lt;div class="ltag__stackexchange--header"&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7Gn-iPj_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackoverflow-logo-b42691ae545e4810b105ee957979a853a696085e67e43ee14c5699cf3e890fb4.svg" alt=""&gt;
          &lt;a href="https://stackoverflow.com/questions/75746811/streaming-error-on-peer-connection-uncaught-in-promise-domexception-the-play" rel="noopener noreferrer"&gt;
            streaming error on Peer connection. Uncaught (in promise) DOMException: The play() request was interrupted by a new load request
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="ltag__stackexchange--post-metadata"&gt;
          &lt;span&gt;Mar 15 '23&lt;/span&gt;
            &lt;span&gt;Comments: 1&lt;/span&gt;
            &lt;span&gt;Answers: 0&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;a class="ltag__stackexchange--score-container" href="https://stackoverflow.com/questions/75746811/streaming-error-on-peer-connection-uncaught-in-promise-domexception-the-play" rel="noopener noreferrer"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y9mJpuJP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackexchange-arrow-up-eff2e2849e67d156181d258e38802c0b57fa011f74164a7f97675ca3b6ab756b.svg" alt=""&gt;
        &lt;div class="ltag__stackexchange--score-number"&gt;
          0
        &lt;/div&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wif5Zq3z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/stackexchange-arrow-down-4349fac0dd932d284fab7e4dd9846f19a3710558efde0d2dfd05897f3eeb9aba.svg" alt=""&gt;
      &lt;/a&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--body"&gt;
    
&lt;p&gt;I am working on video conference React.js app and if i used random ID from peer ,&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const peer = new Peer()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;it is working correctly but if i used specific ID if the user , the call request sent successfully into the other user but stream isn't work for…&lt;/p&gt;
    
  &lt;/div&gt;
  &lt;div class="ltag__stackexchange--btn--container"&gt;
    &lt;a href="https://stackoverflow.com/questions/75746811/streaming-error-on-peer-connection-uncaught-in-promise-domexception-the-play" class="ltag__stackexchange--btn" rel="noopener noreferrer"&gt;Open Full Question&lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;


</description>
    </item>
    <item>
      <title>JavaScript brackets Challenge</title>
      <dc:creator>Aliafify</dc:creator>
      <pubDate>Fri, 06 May 2022 03:30:44 +0000</pubDate>
      <link>https://dev.to/aliafify/bracket-problem-4j55</link>
      <guid>https://dev.to/aliafify/bracket-problem-4j55</guid>
      <description>&lt;p&gt;write JavaScript function which take an a string of brackets as argument and return true if brackets with valid order ' { ( ) [ ] }'  and false if brackets in invalid order  [ ( ] ){ }&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const bracketsString = '(){}[]'
function distribution(a){
 const b = a.split(''); // array of brackets 
const types =[{type:'{',name:'cur',close:'}'},{type:'(',name:'br',close:')'},{type:'[',name:'sq',close:']'}]

let valid =true;
    for (i = 0; i &amp;lt; b.length; i++) {
        if (!valid) { break }
        const Type = types.filter(t =&amp;gt; t.type === b[i]);
        if (Type.length === 0) { continue; }
        const close = Type[0].close;

        let closeIndexs = [];
        for (i = i + 1; i &amp;lt; b.length; i++) {

            if (b[i] === close) {
                closeIndexs.push(i);

            }

        }
        if (closeIndexs.length === 0) {
            valid = false
            break;
        }
        const closeIndex = closeIndexs[0] 
        if (i % 2 === 0 &amp;amp;&amp;amp; closeIndex % 2 !== 0) {
            return valid = true;
        }
        else if (i + 1 % 2 === 0 &amp;amp;&amp;amp; closeIndex + 1 % 2 !== 0) {
            valid = true;
        }
        else { valid = false }

    }
return valid;
}
console.log( distribution(bracketsString))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>#3 React Coding - Show/Hide An Element (Exercise)</title>
      <dc:creator>Aliafify</dc:creator>
      <pubDate>Wed, 27 Apr 2022 12:36:13 +0000</pubDate>
      <link>https://dev.to/aliafify/3-react-coding-showhide-an-element-exercise-52ig</link>
      <guid>https://dev.to/aliafify/3-react-coding-showhide-an-element-exercise-52ig</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/**
  Challenge: Make the button functional
  A click on button should toggle (show/hide) the string `Toggle Challenge` each time it is pressed

  Solution: https://codepen.io/angelo_jin/pen/abLwyrL
  Video for reference: https://youtu.be/VzNNjNmbXpY
**/
function App() {
  const [visible,setVisible] = React.useState(true);

  return (
    &amp;lt;&amp;gt;
      &amp;lt;button onClick={()=&amp;gt;setVisible(!visible)}&amp;gt;{visible?"Hide Element Below":"show Element Below"}&amp;lt;/button&amp;gt;

      {visible&amp;amp;&amp;amp;(&amp;lt;div&amp;gt;Toggle Challenge&amp;lt;/div&amp;gt;)}
    &amp;lt;/&amp;gt;
  );
}

ReactDOM.render(&amp;lt;App /&amp;gt;, document.getElementById("root"));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/angelo_jin/embed/zYERZZL?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>codepen</category>
    </item>
  </channel>
</rss>
